Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Created December 29, 2017 01:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/67d072a76016262703324e8524abc16c to your computer and use it in GitHub Desktop.
Save Shelob9/67d072a76016262703324e8524abc16c to your computer and use it in GitHub Desktop.
Run a callback function on Caldera Forms submit
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'
});
});
@danieliser
Copy link

@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