Master Posted January 12, 2015 Report Share Posted January 12, 2015 How can I disable the enter/return key on a submission to avoid submitting the form from when user press Enter? Quote Link to comment Share on other sites More sharing options...
bahar_vm Posted January 13, 2015 Report Share Posted January 13, 2015 There is a sample script that should disables the enter key. You can place it in the header or footer of your DataPage: <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> Quote Link to comment Share on other sites More sharing options...
IamNatoyThatLovesYou Posted March 21, 2023 Report Share Posted March 21, 2023 Hello @Master, Here is a sample code that you can try as well and insert it in the footer. <script> document.addEventListener('BeforeFormSubmit', function(event) { event.preventDefault(); }); </script> 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.