I want to attach a submit() handler to a form to run an ajax request, and when that comes back, the form submits itself normally. Is this possible? $(‘#myForm’).submit() will just recursively call the same function.
I’d rather not attach the event handler to the click of the submit button, because not all users submit forms with the mouse. Many, like myself, just use the return key.
Try this. In the below code I am unbinding the form submit event handler in ajax success handler and then submitting the form.