How do I make sure that the only way a form is submitted is by clicking the "SUBMIT" button?

  • gchris2
    Asked on February 2, 2015 at 12:10 PM

    Currently any time I hit the "enter" key while filling out the form, it submits.

  • Kiran Support Team Lead
    Replied on February 2, 2015 at 12:57 PM

    To prevent the form to be submitted by pressing Enter key, you may consider adding required status to the fields on your JotForm.

    How do I make sure that the only way a form is submitted is by clicking the SUBMIT button? Image 1 Screenshot 30

    When the form is tried to submit with blank fields, it displays an error for the fields where they were set as required.

    How do I make sure that the only way a form is submitted is by clicking the SUBMIT button? Image 2 Screenshot 41

    Alternatively, you may also consider getting the source code of the from to embed on your webpage by adding the following script to header section i.e., in between <head></head> tags.

    <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>

    Hope this information helps. Please let us know if you need any further assistance.

    Thanks!