How to control when the form is get submitted?

  • Profile Image
    Asked 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!



  • Profile Image
    Answered on January 07, 2016 at 09:06 PM

    I forgot to attach the it is:

  • Profile Image
    Answered 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.srcElement) ? evt.srcElement : null);

      if ((evt.keyCode == 13) && (node.type=="text"))  {return false;}



    document.onkeypress = stopRKey;




     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.

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

  • Profile Image
    Answered 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...


    Looking forward for a solution





  • Profile Image
    Answered 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.