Jump to content

Submit record via "Enter" key


Recommended Posts

Hi.

If you want to submit a form by pressing the "enter" button on the keypad and go to a new line by pressing SHIFT+ENTER than you should do the following:
1) On your form header paste this jQuery link:

<script src="https://code.jquery.com/jquery-3.3.1.min.js" type="text/javascript" charset="utf-8"></script>

2) On your form footer paste this jQuery code:

<script type="text/javascript">

$("#InsertRecordComment").keypress(function (e) {
     if(e.which == 13 && !e.shiftKey) { 
          $(this).closest("form").submit();
          e.preventDefault();
          return false;
     }
});

</script>
 

Where "InsertRecordComment" - it's an ID of your text area element

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...