• Resolved Logan Yott

    (@loganyott)


    Hi!

    So I’m trying to attach an event handler to a form submission. Right now, I have two instances of the same form on a page, both flagged to use ajax.

    I can attached event handlers to gform_confirmation_loaded, gform_post_render, and $.change events on actual form elements. These (except for gform_confirmation_loaded) fire on the first form submission correctly. However, it appears none of these trigger on the second form submission.

    Have you encountered anything like this already and have found a workaround? I’ve been beating my head against this for awhile with no luck. Thanks!

    https://www.ads-software.com/plugins/gravity-forms-multiple-form-instances/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Marin Atanasov

    (@tyxla)

    Hi Logan,

    I’ve just conducted a couple of tests and concluded that everything is working as expected. For the test, I’m using twentyfifteen, with 2 forms on the same page, and the following script added:

    jQuery(function($) {
    	$(document).on('gform_post_render', function() {
    		console.log('test');
    	});
    });

    And each time, on each form submission, on both forms, the message is logged correctly in the console. So everything is working correctly in my tests. I guess I’d need some more information about your use case in order to reproduce your issue.

    And regarding the “change” event, make sure to add it for elements that are created in the future (by adding delegated event handlers). Please, let me know if you need guidance on that.

    Plugin Author Marin Atanasov

    (@tyxla)

    Hey Logan,

    Were you able to get it working already? Do you need any further assistance?

    Plugin Author Marin Atanasov

    (@tyxla)

    Hey Logan,

    Were you able to get it working already? Do you need any further assistance?

    Thread Starter Logan Yott

    (@loganyott)

    Hi Marin,

    Thanks for the quick response and running those tests. At least I now know the issue isn’t systemic. Unfortunately, I still haven’t found a resolution.

    Since it clearly isn’t the plugin though, I guess it’s time to start flipping everything off and turning it back on one by one.

    Plugin Author Marin Atanasov

    (@tyxla)

    Hi Logan,

    Please, let me know if I can assist you with finding a solution. Otherwise, feel free to mark this topic as resolved.

    Thread Starter Logan Yott

    (@loganyott)

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘JS hooks not working on second submit’ is closed to new replies.