After dynamically changing a form submit function causes old function to get called once then new fu
- by cnobile
I am setting the submit function on a form with jQuery then later in the process I reset the function to something else. What happens is the original function gets called again then the new function when only the new function should have been called.
I am sending the requests with AJAX. The first one validated the values on the server then asks if you want to continue. Clicking the submit again should only call the changed function but for some reason both get called simultaneously with a single click.
What is happening here? Could jQuery be delaying the the setting of the 2nd function on the form submit?