Submission steps provide a way to intercept a form submission and run custom JavaScript immediately before. This is useful if you perhaps want to fire tracking events or implement something that requires some JavaScript-based handling before the payload is sent to the server.
acf.addAction( "af/form/setup", function( form ) { af.addSubmissionStep( form, 10, function( callback ) { // Add your custom JS code here... // Invoke the callback to allow the next submission step to fire. If this is not called, the form won't submit and any submission handlers with a later priority won't be invoked. callback(); }); });
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article