Skip to content

Instantly share code, notes, and snippets.

@New0
Last active October 10, 2019 13:54
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 New0/5671b276b07203825154a1e5f8c2e15b to your computer and use it in GitHub Desktop.
Save New0/5671b276b07203825154a1e5f8c2e15b to your computer and use it in GitHub Desktop.
Force process state, start spinner and deactivate fields on submit button click for Caldera Forms.
<?php
/*
* Plugin Name: CF Force process state
* Description: Force process state, start spinner and deactivate fields.
*/
add_filter('wp_footer', function(){
echo '<script type="text/javascript">
jQuery(".caldera-grid input[type=\'submit\']").on("click", function() {
var form = jQuery(this).parent("form");
jQuery(".caldera-grid").data("cf-form-id", form.id ).addClass("cf_processing");
});
</script>';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment