Forked from spivurno/gw-gravity-forms-disable-submission-on-enter.js
Created
September 5, 2016 04:18
-
-
Save phillipwilhelm/6a3a7935111003814f003a9074e39640 to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Disable Submission when Pressing Enter
This file contains hidden or 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