Enter key is submitting incomplete form. How do I deactivate?

  • Profile Image
    Asked on December 31, 2011 at 07:30 AM

    Anytime the Enter key is pressed, it is causing my form to be submitted.  How do I disable this?

    Too many people will press the enter key instead of using mouse or tab key.


  • Profile Image
    Answered on December 31, 2011 at 08:26 AM

    To prevent your forms from getting submitted when pressing the enter key, you can try setting the fields as required by clicking on the form element and then turning on 'Required' tool in the tool bar, just above the form editor.

    This way, if they press enter, it will alert the form that there are still some required fields that are left blank.

    Another alternative way is exporting your HTML source code to your own HTML file.  Then you can paste this code within the header (<head> script here </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;

    Please let us know if you need further assistance regarding this matter.

  • Profile Image
    Answered on December 31, 2011 at 08:40 AM
    Thanks, I did that a few minutes ago.