How to avoid Submission without clicking on Submit button?

  • Profile Image
    winsberry
    Asked on December 11, 2012 at 03:53 AM

    Hello,

     

    How to avoid Submission event without clicking on Submit button?


    We have created Rule:

    HIDE Submit button is Phone Number is not Equal to EXACT NUMBER.

     

    But, form possible to send even WITHOUT Submit button, just by pressing 'Enter'.

    How to make form submitting impossible by pressing Enter? 

     

    Thanks!

  • Profile Image
    liyam
    Answered on December 11, 2012 at 06:05 AM

    Hello winsberry.  The best solution for this is to get your form's HTML source and then place it on your web page.  Then insert this javascript code within the <head>  and </head> tags:

    <script type="text/javascript">

    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>

    Please let us know if you need further assistance.

  • Profile Image
    winsberry
    Answered on December 11, 2012 at 06:29 AM

    Thanks! But where in the form bulder I can find HTML source to insert this code? My form is not embed... May I insert this scropt into Custom CSS field?

  • Profile Image
    liyam
    Answered on December 11, 2012 at 06:37 AM

    Unfortunately, no.  You cannot insert javascript codes in your form here in JotForm.  You will need to get your form's HTML code by following this user guide: http://www.jotform.com/help/104-How-to-get-your-Form-Source-Code

    Next, create an HTML file and paste the HTML code you copied and then save. 
    Next, upload the file on your website.

    Please let us know if you need further clarification on this.

    Thanks.

  • Profile Image
    Sean
    Answered on March 07, 2015 at 11:13 AM

    It seem as if your post did not go through successfully - sorry about that. You can have a new thread created here so that we can address your issue separately. 

    Thanks.