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

Only tabs with a " " have code.
<!-- DISABLE SUBMIT WITH ENTER KEY --> 
<script>
$(document).ready(function() {
  $(window).keydown(function(event){
    if(event.keyCode == 13) {
      event.preventDefault();
      return false;
    }
  });
});
</script>
Only tabs with a " " have code.
Only tabs with a " " have code.
Author
N/A
Published
May 8, 2021

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

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