Vitalikssssss Posted May 15, 2018 Report Share Posted May 15, 2018 Hi everyone, Does anyone know how to submit textarea field by pressing Enter button on the keypad? Quote Link to comment Share on other sites More sharing options...
Alison Posted May 15, 2018 Report Share Posted May 15, 2018 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.