I'm using Gravity Forms and after submission I want to use its built-in action add_action( 'gform_after_submission', 'after_submission', 10, 2 ); to trigger a couple of click events from 2 different elements in that page. Is it possible? If so, how is it done?

2 Answers 2


That's not possible (well, not without building super weird things). Action hooks are server side in PHP, clicks happen on the client side.

You should probably use JavaScript to run the actions when the form is submitted. With jQuery, this could be as easy as

jQuery("#formid").submit( function() {

Depending on what else you need to verify first.


It seems it's not really necessary to use php for this, but just bind will do the trick:

$(document).bind('gform_confirmation_loaded', function($){

And that's it! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.