Jump to content

When pressing 'enter' in a custom field, it sends me back to the main product selection page?


-M-

Recommended Posts

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? :P

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 by MvdL1979
Added an idea for a workaround...?
Link to comment
Share on other sites

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. :idea:

 

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! :)

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated