What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    How to control when the form is get submitted?

    Asked by Effie  on January 07, 2016 at 09:05 PM

    Hi There,

    It has happened to me twice now, when I tested my form and filled in a few fields, that I hit the Enter key by accident and the form has been sent before I finish or before I clicked the submit button! How to prevent it from happening?

    I want the form to be submitted only when I hit 'Submit' .

    Thank you!

    Effie

     

    how Enter key and OR thank
  • Profile Image

    Answered by Effie  on January 07, 2016 at 09:06 PM

    I forgot to attach the form....here it is: http://transaustremovals.com.au/calculator/

  • Profile Image
    JotForm Support

    Answered by beril on January 08, 2016 at 04:19 AM

    We are sorry for this inconvenience this might have caused. I've also cloned and tested your form. I am able to reproduced same issue that you are having.

    You can solve that issue with adding Javascript code below inside your <head>....</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>

     If it doesn't work I suggest you to embed your form with source code. Then, add the javascript code above.

    Please, check the guide below for more information.

    http://www.jotform.com/help/104-How-to-get-the-Full-Source-Code-of-your-Form

    If you have any question or issues, please do not hesitate contacting us. We will be glad to assist you.

  • Profile Image

    Answered by Effie  on January 08, 2016 at 10:41 AM

    Hi Beril,

    Thanks for your reply. Sorry but it didn't work to add the Javascrip into the 'head' (I did it by edit my Theme head.php and pasted the script that you gave me in there between the <head>....</head> tags- if this is what you meant? I don't have much experience with coding...).

    The other option to embed it with the source has messed up my form... :-(

    I then re-embedded it again with Iframe as suggested me by another support person. Here is the link to the other discussion relating to another problem I had and his solution has worked for me...  http://www.jotform.com/answers/734855-Multi-Pages-Form-using-Form-Tabs-did-not-work-well

     

    Looking forward for a solution

    Thanks,

    Effie

     

     

  • Profile Image
    JotForm Support

    Answered by BJoanna on January 08, 2016 at 01:44 PM

    I have inspected your form and I saw that you have embedded your form with iFrame code. After that I tested your form and I was able to submit your form when I pressed enter key on last page of your form.

    Workaround provide by my colleague requires that you embed your form with full source code and to add provide code to your embedded page as well. 

    Other possible workaround would be to add one additional page to your form. For example on last page of you form you can only have submit button. You can also make your fields required. That way your users will not be able to submit your form without filling required fields. 

    If you do not want to embed your form with full source code, then I would suggest you to add one additional page break and leave only submit button and one required field on last page of your form. 

    You can make your fields required inside of Form Builder. Simply select field that you want to be required and click on Require option. 

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