This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

Disable Enter Form Submission


  1. PDXMan
    Member

    You had instructions for the previous version of MachForm on how to prevent enter from submitting the form. http://www.appnitro.com/forums/topic/enter-disable?replies=4#post-5376. How do I do this in this latest version? I have a client that does not like this functionality. Thanks!

    Posted 13 years ago #
  2. redityo

    In Machform 3, you can edit "includes/view-functions.php" file and go to around line 4529. You will see these codes :

    <script type="text/javascript" src="{$machform_path}view.js"></script>

    then simply add the java script bellow that line to disable the enter key

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

    MachForm Support

    Posted 13 years ago #

RSS feed for this topic

Reply