How do I edit source code to stop form submitting when Enter is pressed?

  • Profile Image
    Asked on November 13, 2015 at 03:04 PM

    I have seen other forum posts about how to stop a form from submitting when Enter is pressed.  This is happening on at least one of our forms, but I don't want it to submit unless the Submit button is clicked.  I have never edited Source Code before so I don't know how to do this.

  • Profile Image
    Answered on November 13, 2015 at 03:27 PM

    To be able to edit the source code of the form, you will need to get it first using the Form Builder. And then add it to your own hosted website.

    user guide: -How-to-get-the-Full-Source-Code-of-your-Form

    The source code can be edited using any text editor or web page editor.

    Hope this help. Let us know if you need further assistance.


  • Profile Image
    Answered on November 16, 2015 at 10:47 AM

    I guess this isn't the solution I need.  I am not embedding this form into my website.  I am just working off the jotform link.  When I am testing out the form, it automatically submits whenever I hit Enter...but I want it to only Submit if I click on the Submit button.  I have made most all the fields required, so at least it won't submit until it's completed, but I want the user to be able to check every field and be 100% they are ready to submit...I don't want it to submit when they accidentally hit the Enter button.  Only when they click on the Submit button to confirm they are ready to send.


    This is the link to the form that is having this problem:

  • Profile Image
    Answered on November 16, 2015 at 10:49 AM
  • Profile Image
    Answered on November 16, 2015 at 01:14 PM

    Unfortunately it is not possible to edit the source code without hosing the form on your website (or on a website of someone else).

    Having that said, it means that it is not possible to stop the form from submitting when Enter/Return is pressed.

    Now the reason why it happens is because this is a form and forms will always submit when Enter is pressed.

    Making more fields as required - as you have mentioned, will ensure that they can not submit the form until these fields are filled out.

    The other thing that you can do is to have one more field set as required on a hidden page of your form and set the conditions to check the fields if they are (all or the important ones) filled out. Once they are, you remove the required tag from that field through conditions.

    - This is a possibility of how to do it without setting to many required fields, but that could (a possibility) raise other issues.