Created
December 29, 2017 01:02
-
-
Save Shelob9/67d072a76016262703324e8524abc16c to your computer and use it in GitHub Desktop.
Run a callback function on Caldera Forms submit
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
jQuery( document ).on( 'cf.form.submit', function (event, data ) { | |
//data.$form is a jQuery object for the form that just submitted. | |
//log form id | |
console.log($form.data( 'form-id' ) ); | |
//apply a css to form | |
$form.css( { | |
visibility: 'hidden', | |
display: 'none' | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@TomLeogrande, not quite as familiar with the internal workings of the plugin as a whole. From just the surface, I'd say there has to be a server side PHP filter you could use to clean up that data pre-save.
Our use case was detecting ajax submissions inside a popup, so we could interact with the popups own API to close on submission, trigger a thank you popup, set cookies etc. So I never had to really mess with what happened with the submission server side, just needed to ensure it only processed our stuff when it was a true success.