Can I disable the return key so it doesn't send the form when pressed. Some people use the return key to try and tab to the next field.

  • Profile Image
    Asked on January 18, 2013 at 12:26 PM
  • Profile Image
    Answered on January 18, 2013 at 01:03 PM


    You can make the fields required so when they press enter key, the from will not submit and a warning message will be displayed.

    Another solution is to use your form source code and apply custom scripts to stop key events on your form. Here's a good one:

    <script language=javascript type=text/javascript>

    <!-- Script courtesy of - Your Guide to Professional Web Site Design and Development 

    function stopRKey(evt) {

       var evt = (evt) ? evt : ((event) ? event : null);

       var node = ( ? : ((evt.srcElement) ? evt.srcElement : null);

       if ((evt.keyCode == 13) && (node.type=="text")) {return false;}


    document.onkeypress = stopRKey; 



    Simply add the code between <head> tags of your forms html code. Thanks!

  • Profile Image
    Terry McCue
    Answered on June 20, 2013 at 01:30 PM

    The form source code does not work on my form. Making the fields rquired is not an option. I've dowloaded the source code and placed it on my web page with the form source code inserted between <head> and </head> as instructed. I'm using IE9.

  • Profile Image
    Answered on June 20, 2013 at 02:10 PM

    Disregard, I resolved issue

  • Profile Image
    Answered on June 20, 2013 at 02:13 PM

    Please feel free to contact us if you need any further assistance.

  • Profile Image
    Answered on June 20, 2013 at 02:24 PM

    Thanks, I used the wrong technique to get the source code of the form. Once I realized that and did it correctly it works fine.

    What could be helpful to others with this issue is that in addition to inserting the code that inactivates the ENTER key in the HEAD section, the FORM source code must be also imbedded into the HTML code of the page the form is being added to. I tried to place the source code inside a locally created file and just point to that file thinking this would be an easier way of updating if/when I made modifications to the form. When I did this, however, all I got was a blank area where the form was supposed to appear. It's a little more work to replace all of the source code if you update the form, but not having the ENTER key accidentally submitting the form before it's completed is still worth it. Thanks for your help in getting this resolved.
    Terry McCue

  • Profile Image
    Answered on December 19, 2015 at 05:22 PM

    The best solution is to add a radio button at the end, just above the submit button.

    "I am ready to submit this form." Option = YES

    Now, add a conditional logic to enable the submit button only if the radio button is checked.

    This will disable Submit and avoid the premature submission of the form if the user presses the Enter button on their keyboard.


  • Profile Image
    Answered on December 19, 2015 at 11:38 PM

    Hi   DougMarlowe ,

    Thank you for your suggestion on this thread.

    Please, if you need help, feel free to contact us.