What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    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.

    Asked by HippoGFX on January 18, 2013 at 12:26 PM
    next
  • Profile Image
    JotForm Support

    Answered by idarktech on January 18, 2013 at 01:03 PM

    Hi,

    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 http://www.web-source.net - Your Guide to Professional Web Site Design and Development 

    function stopRKey(evt) {

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

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

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

    }

    document.onkeypress = stopRKey; 

    -->

    </script>

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

  • Profile Image

    Answered by Terry McCue 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 by tcmccue on June 20, 2013 at 02:10 PM

    Disregard, I resolved issue

  • Profile Image
    JotForm Support

    Answered by Mike_T on June 20, 2013 at 02:13 PM

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

  • Profile Image

    Answered by tcmccue 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 by DougMarlowe 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
    JotForm Support

    Answered by Kevin_G 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.

    Regards.