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' | |
}); | |
}); |
@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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a similar issue I am trying to resolve.
Danieleliser, would have any thoughts on this you would be willing to share?
I have a Caldera Form that I do not want to save one of the fields on submission. I want to set a field - null either before submission or clear it from the database after submission.
Any thoughts on the best way to do this would be great.
Thanks,