Created
July 30, 2013 08:59
-
-
Save bhays/6111394 to your computer and use it in GitHub Desktop.
Change 'Submit' button to 'Processing...' and disable it
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
add_filter('gform_pre_render', 'disable_submit'); | |
function disable_submit($form) { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($){ | |
$('#gform_submit_button_<?php echo $form['id']; ?>').on('click', function(event){ | |
var submitCopy = $(this).clone(); | |
submitCopy.prop('id', '').prop('disabled', true).prop('value', 'Processing...').insertAfter($(this)); | |
$(this).hide(); | |
}); | |
}); | |
</script> | |
<?php | |
return $form; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've got an error on line 9 that prevents messages to be sent.