jQuery callback after Gravity Form submit jQuery callback after Gravity Form submit wordpress wordpress

jQuery callback after Gravity Form submit


You can call jQuery that has to be run after gravity form submit like this

<script type="text/javascript">jQuery(document).bind('gform_post_render', function(){   addServiceListeners();});

Here is detail about 'gform_post_render' that is provided by Gravity form.https://www.gravityhelp.com/documentation/article/gform_post_render/


user2745337 has the correct answer! To elaborate on the solution, you should take your code and wrap it in a function. Call the function on your normal page load (or don't, up to you).

When the gform_post_render fires, you can then call your function (addServiceListeners())

===========

<script>function addServiceListeners(){   alert("Do AJAX DOM problem stuff here :)";}addServiceListeners(); // call it on page load? Go for it.jQuery(document).bind('gform_post_render', function(){   addServiceListeners();});</script>