Last active
October 10, 2019 13:54
-
-
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.
This file contains 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
<?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