Execute custom JavaScript code after Webform has been submited with Webform Ajax Module I have an Webform that uses Webform Ajax modules, Steps module and few others.

I would like to execute some custom JavaScript code after the WebForm has been validted and submited.

I know I could execute custom PHP code by modyfing function _webform_ajax_callback_completed($form, $form_state) {...} inside of webform_ajax.module:

elseif ($form['#node']-&gt;webform['webform_ajax'] == WEBFORM_AJAX_CONFIRM){
...
//my custom code
...


But I don't want to mess with this module's code. And I want to execute JavaScript not PHP code.

Is there an way to do so, e.g. via some hook? Or maybe I can detect that form has been submited in JavaScript?
Okay, try this. After the ajax request is completed on "#myform", it runs the function.

$("#myform").bind('ajax:complete', function() {

     // tasks to do 


});


Source | API Documentation