In my client-side code, I:
- Populate hidden fields in a form.
- Wait for the user to fill in fields such as Name, Email.
- The user clicks [Submit] or [Cancel].
- Assuming [Submit] was clicked, I assemble data, make a jQuery.ajax POST request, and repopulate the page with the result.
The various forms have reached enough complexity that the jQuery validation plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/ would be of great assistance. I have used it in various other projects.
However, I have never used it as part of a larger javascript/jQuery work flow. When the user clicks Submit, I want to run Validate against that html form (and only that form, there are several on the page). If validation fails, display the error messages (normal Validation behavior). If validation passes, continue on to my existing AJAX processing code.
How can I accomplish this, i.e., insert jQuery form validation between steps 3 and 4 above?
I apologize for not posting the code. It is subject to non-disclosure.