spivurno
6/22/2015 - 11:30 PM

Gravity Wiz // Gravity Forms // Disable Submission when Pressing Enter

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>