-M- Posted July 4, 2016 Share Posted July 4, 2016 (edited) Hi all, I am experiencing a weird issue. I noticed this already some time ago, but didn't follow up on it. When I select a product on the product/service selection page which has a custom field, I notice a small issue. When I fill in the custom field followed by pressing 'enter' it will go back to the product selection page instead of continuing to the checkout form. The URL, or better said what's behind it will show this: "cart.php?configure=true&i=0&customfield[1]=dasdas55345" If I instead click on the button "Continue" (on the right side) it works, it only happens when I press 'enter' after entering text in the custom field. Below is the html part of this custom field, though I don't know if it's helpful... <div class="form-group"> <label for="exampleInputEmail1">Geef forward adres op</label> <input name="customfield[1]" id="customfield1" value="" size="30" class="form-control" type="text"> <span class="field-help-text"> Geef het adres op waar de domeinnaam naar toe moet verwijzen. </span> </div> Is there a way, to make 'enter' behave as you were clicking on the "Continue" button? Seems I am always having weird issues. Maybe this is because I am weird a bit myself? If it's not fixable and/or if there is no workaround for it, never mind. It's not like it's a major concern, but more something annoying. Thank you in advance for reading and your help/advice. //update If a fix is not possible, is it possible to disable "enter" for the custom field? That would force an user to click the "Continue" button as well and would also be a solution?? Edited July 4, 2016 by MvdL1979 Added an idea for a workaround...? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 4, 2016 Share Posted July 4, 2016 I think the quick fix would be in standard_cart/configureproduct.tpl to change... <form id="frmConfigureProduct" onsubmit="catchEnter(event);"> to... <form id="frmConfigureProduct" onsubmit="catchEnter(event);" onkeypress="return event.keyCode != 13;"> that should disable the enter keep from submitting the form. there might be an issue if you are using a textarea option in your product custom fields (where you would want enter to work as a carriage return) - if you are, then you would need to add the onkeypress bit of code to the <input> lines instead, for every customfield that is NOT a textarea... untested, but I assume you would just see if $customfield.input contained '<textarea' and if not, add the above code using a replace. though hopefully you aren't using any textareas for customfields! 1 Quote Link to comment Share on other sites More sharing options...
-M- Posted July 5, 2016 Author Share Posted July 5, 2016 Hi brian! Thank you for responding. The change you have given me works flawlessly. I actually also do use the textarea option, however it's only used for entering a CSR-code (for SSL), so it's copy paste. So it doesn't matter in that case. It's weird though that noboody else had this problem? Also pressing enter when searching for a domainname does work as it should. Anyways, it doesn't matter. This workaround is perfect for me. Thanks brian! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.