Can we make the submit button compulsory?

  • Profile Image
    olay
    Asked on November 16, 2011 at 07:19 AM

    Hi,

    We created a form to be used on iPad and many users reported that they hit the "Return" key by mistake (instead of a delete button which is easily done) and the form is submitted without the user actually click on "Submit" button.

    Is there anyway that we could either make the Submit button compulsory i.e. users must click to submit the survey

    OR disable the return key somehow.

    I'd really appreciate your advice.

    Many Thanks

     

    Olay

  • Profile Image
    liyam
    Answered on November 16, 2011 at 01:31 PM

    This is possible but not within the JotForm's functionality or while it's hosted in JotForm.

    You will need to embed the HTML source code to your own webpage as this requires javascript for it to happen (Unfortunately, you cannot code javascript in JotForm's form editor).

    To do this, create your own HTML page and then copy and paste the source code to your HTML file. Next, insert this script below within the opening and closing header tags of your HTML source code:

    -----------------------------------------------------

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

    -----------------------------------------------------
    reference source(link):

    Please let us know if you need further assistance.