How do I get a jQuery dialog window to display only if a form validates when I click the submit butt
Posted
by user338413
on Stack Overflow
See other posts from Stack Overflow
or by user338413
Published on 2010-05-13T13:32:51Z
Indexed on
2010/05/13
13:34 UTC
Read the original article
Hit count: 341
I've got a form that is using jQuery validation. When the user clicks the submit button, a dialog window displays thatshows the fields the user filled out along with the data the user entered. It asks the user if this information is correct. If it is, the user clicks the submit button in the dialog window and the form is submitted. If the user clicks the 'Fix it' button, the dialog window closes and the user returns to the form.
My problem is my dialog window displays when the user clicks the form's submit button even if there are errors in the form. I only want to display the dialog window if the form data is validated by jQuery. How do I do this?
I'm thinking of something like: if ((#form).validates() == true) { $('#verification_dialog').dialog('open'); }
Is there a way in jQuery to determine whether the whole form has validated? Or do I have to create my own function to do this?
© Stack Overflow or respective owner