Sending on every field

  • FrankBalistreri
    Asked on May 22, 2015 at 11:09 AM

    Hi

    I am having an issue with all my forms sending if you hit enter on any field. Not sure what happened?

  • Chriistian Jotform Support
    Replied on May 22, 2015 at 12:16 PM

    Hi FrankBalistreri,

     

    Thanks for contacting us.

     

    I cloned your form and tested. Indeed it is submitting on hit of Enter on every field but I think it is a normal behavior that a form attempts to submit itself when a user hits enter on a field.

     

    You can, however, prevent your form from submitting with all fields empty by setting some of your fields (e.g. Name, Email, etc.) as required. To avoid having empty form submitted, please see below.

    Sending on every field Image 1 Screenshot 20

     

    If you need further assistance, do let us know.

     

    Regards.

  • FrankBalistreri
    Replied on May 22, 2015 at 12:30 PM

    Hi Christian

    I have 30 years forms design experience, I don't wish to disagree but sending from every field not matter what action is taken.
    not an expected action by the user. If we require field it throws the form into an unneeded error state.
     
    Do you have any other work around? Is there a pop that says "are you sure you want to send this form now?" that would halt their actions after the first field.
  • Aurora JotForm Support
    Replied on May 22, 2015 at 1:09 PM

    Hello FrankBalistreri,

    As an alternative suggestion to prevent form is prematurely submitted when hitting enter is exporting your HTML source code to your own HTML file.  Then you can paste this code within the header (<head> script here </head>) tags:

    <script language=javascript 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 regarding this matter.