Forked from spivurno/gw-gravity-forms-disable-submission-on-enter.js
Created
April 4, 2016 05:33
-
-
Save seancojr/796b31bc48a8e47e9f209ed50432cc69 to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Disable Submission when Pressing Enter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment