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

    Pressing Enter is Submitting the Form

    Asked by patricefn on October 25, 2015 at 08:13 PM

    Good Morning,

     

    We have an offer sheet form set up and when pressing enter in a field it automatically submits it. I have had a look in the settings and cannot find a way to disable this. Can you please help. Thankyou Patrice

    Page URL:
    https://form.jotform.com/52880903681966

    pressing enter enter required
  • Profile Image
    JotForm Support

    Answered by mert on October 26, 2015 at 04:37 AM

    Hi there,

    As a quick solution, you can make some of your fields "Required", so the form doesn't accept the "enter" key command.

     

    To do that, select desired field, then click the "Required" button.

     

    I hope this one will help.

    Thanks.

  • Profile Image

    Answered by patrice on October 26, 2015 at 11:52 PM

    Hi Mert

     

    Unfortunately we cannot make all fields required as they are not and clients using the form will not have all the details for every field sometimes. is there another way around this? 

     

    Thanks 

    Patrice

  • Profile Image
    JotForm Support

    Answered by mert on October 27, 2015 at 03:44 AM

    Hi again,

    Patrice, I understand what you are trying to say. If so, we need to try more advanced method to achieve.

     

    To do this,

    1) You need to get your form's HTML source code.

     

    2) You need place that source code to your web page.

    3) Then, insert the following javascript code inside the <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>

     

    I hope this method is what you really need. Please, let us know, if you encounter any error.

    Thanks.

  • Profile Image

    Answered by patricefn on October 27, 2015 at 07:08 PM

    Hi Mert, We were only going to be using the link for the form not importing it into the website. Is there a way to prevent the enter button submitting the form when only using the link or must it be put on our website as that is really not ideal. Would you like our login details? 

  • Profile Image
    JotForm Support

    Answered by jonathan on October 27, 2015 at 11:45 PM

    I checked your jotform https://form.jotform.com/52880903681966 and I found that none of the form fields were set as *Required .

    This means that the form can be submitted without answering or providing any data at all.

    I suggeste you set at least one field as mandatory or *Required so that the end user will be oblige to provide the necessary data before they can submit the form.

    This option will also prevent the form from getting submitted unintended with empty data when using the Enter keyboard. 

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

  • Profile Image

    Answered by patricefn on October 28, 2015 at 12:31 AM

    Hi Mert and Jonathan

    I have changed some fields to required but if those fields have been filled in and they press enter accidentally it still submits the form. We cannot make all fields required as they may not have all the information to fill all fields

     

     

    Thankyou

  • Profile Image
    JotForm Support

    Answered by mert on October 28, 2015 at 02:37 AM

    Hi again,

    Patrice, you can use "Show/Hide a Field" condition to hide submit button. By doing this, submit button will remain hidden until every field is filled.

     

    To add this condition, you need to open "Conditions", then select "Show/Hide a Field". 

     

    The settings for that condition will be like the following image. This condition will work like a "Required", but do not let the user pass until every single field is filled. A

     

    I think this one will help you. Please, let us know the updates.

    Thanks.

  • Profile Image

    Answered by patricefn on October 28, 2015 at 02:44 AM

    Hi Mert, 

     

    this will not resolve the issue. As i have said multiple times before in this thread - our clients may not fill in every field. They may not have the information to fill in every field. '

    We basically need it disabled for our account for forms to be submitted via the enter button. 

    None of the suggestions match what we are looking for and i feel like we are just going around in circles. 

     

    Thankyou 

    Patrice 

  • Profile Image
    JotForm Support

    Answered by mert on October 28, 2015 at 04:20 AM

    Hi Patrice,

    I understand what you want and I have an alternative solution for you. Adding a "Captcha" to your form could prevent submitting with "Enter" key.

     

    To add "Captcha" to your form,

     

    In addition, you have some other captcha alternatives on "Widgets" tab.

     

     

    Please, let us know the updates.

    Thanks.

  • Profile Image

    Answered by patricefn on October 28, 2015 at 08:20 PM

    We really would prefer not to put a captcha on the form as this is an official offer sheet to purchase a house and a captcha on it makes it look unprofessional. 

  • Profile Image
    JotForm Support

    Answered by jonathan on October 28, 2015 at 09:49 PM

    By default the Enter key will submit the form https://form.jotform.com/52880903681966 once the Submit button or a Textbox fields are the focused element on the form.

    This is a built-in process.

    We have been suggesting to you different ways that will stop the form submissio if no data was provided yet. If you do not put *Required to any of the questions/fields on your form, then the form will not be able to capture data/info when it is submitted.

    If you really want to block the Enter key, then you will have to influence the form function using additional script function.  This option was suggested already by our colleague mert

    You will need to use the form's source code though as it will not work if using only the link/URL of the form.

    To do this,

    1) You need to get your form's HTML source code.

     

    2) You need place that source code to your web page.

    3) Then, insert the following javascript code inside the <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>

     

    Let us know if  you need further clarification on this.

     

     

     

  • Profile Image

    Answered by Helenium on April 07, 2016 at 05:12 PM

    RE: <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>

    I put that script on my page (I use Dreamweaver and know how to do that) and it still submits the form when pressing the <enter> key. Even worse, I have a conditional calculation on my form, that says to check one box if you're a NY State resident and the other if you're not. Hitting "return" defaults to NY State, causing sales tax to be added as the form submits.

    I can see from reading the other answers to this question that JotForm doesn't think this is a necessary option, but if that's the best you've got, JotForm won't work for us! We can't have clients receiving receipts saying sales tax has been automatically added when it shouldn't be.

  • Profile Image
    JotForm Support

    Answered by Nik_C on April 07, 2016 at 05:46 PM

    I'm sorry, we are doing our best to find solution that will work for you. 

    Could you please try to input this script code:

    $("form").bind("keypress", function (e) {

        if (e.keyCode == 13) {

            $("#btnSearch").attr('value');

            //add more buttons here

            return false;

        }

    });

    or you can use also e.preventDefault() instead of return false.

    Please let us know if this works for you.

     

  • Profile Image

    Answered by Helenium on April 07, 2016 at 08:54 PM

    No, same problems -- hitting <enter> submits the form and adds the sales tax when it's not supposed to. I tried it with return false; e.preventDefault() and e.preventDefault();. All the same result.

  • Profile Image
    JotForm Support

    Answered by jonathan on April 07, 2016 at 10:02 PM

    @Helenium

    I created a dedicated thread to your issue here https://www.jotform.com/answers/813418

    Let us resolve it separately on that thread.

    Thanks.

  • Profile Image

    Answered by Helenium on April 08, 2016 at 01:45 PM
    Okay, thanks!
    ...