Skip to content

Instantly share code, notes, and snippets.

@bhays
Created July 30, 2013 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhays/6111394 to your computer and use it in GitHub Desktop.
Save bhays/6111394 to your computer and use it in GitHub Desktop.
Change 'Submit' button to 'Processing...' and disable it
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;
}
@bluantinoo
Copy link

I've got an error on line 9 that prevents messages to be sent.

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