Disable Form Submit with the "Enter" Key

</ head>

</ body>

<!-- DISABLE SUBMIT WITH ENTER KEY --> 
<script>
$(document).ready(function() {
  $(window).keydown(function(event){
    if(event.keyCode == 13) {
      event.preventDefault();
      return false;
    }
  });
});
</script>

HTML/Embed

Author
N/A
Published
Jun 12, 2020

How to use:

Simply paste this code on any page (in the </ body> code section of the page settings) that has a form in which you would like to disable the enter/return key from submitting. if you have multiple forms throughout many different pages then it might be better to paste the code in the global Site Settings > Custom Code > </ body>. This can be very useful for stopping accidental key presses or to use in combination with the "Reveal Submit ButtonWhen Email is Validated" code crumb.

Tutorial Coming Soon!

Check Browser Support

Interactive Table

Comments

Unfortunately at this time we don't have SSO for comments so you will have to sign up separately to leave your comment. Thanks for understanding!

Simple code to stop or prevent the enter or return key from submitting a form.

Clone Project
Documentation
Author:
Built by
Built with
For the best experience

Please switch to desktop to view the content.

Back Home
Thank you! Your submission has been received!
Close Form
Oops! Something went wrong while submitting the form.
Become a Contributor