Skip to content

Instantly share code, notes, and snippets.

@spivurno
Last active October 13, 2021 14:44
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save spivurno/ba324932fec077f49ef1 to your computer and use it in GitHub Desktop.
Save spivurno/ba324932fec077f49ef1 to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Disable Submission when Pressing Enter
<script type="text/javascript">
/**
* Gravity Wiz // Gravity Forms // Disable Submission when Pressing Enter
* http://gravitywiz.com/disable-submission-when-pressing-enter-for-gravity-forms/
*/
jQuery(document).on( 'keypress', '.gform_wrapper', function (e) {
var code = e.keyCode || e.which;
if ( code == 13 && ! jQuery( e.target ).is( 'textarea,input[type="submit"],input[type="button"]' ) ) {
e.preventDefault();
return false;
}
} );
</script>
@spivurno
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment