How can I stop the 'Return' button from triggering the submit button?

  • ModestMedia
    Asked on April 29, 2016 at 1:47 AM
  • beril JotForm UI Developer
    Replied on April 29, 2016 at 4:39 AM

    If you want to prevent submitting the form when user presses the return key you can add the following code between your 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>

    To do that, you need to download your source code.

    If this does not resolve the issue, please let us know and we will be glad to take another look.