Why is this jquery dialog window not displaying?
- by user338413
I've got a form that is using jquery validation. When the user clicks the submit button, I've got some jquery that intercepts the submit and should display a dialog window asking the user to verify the information they entered on the form. This dialog window should only display if the form has validated. Here is my code:
$('#form').submit(function(){
fillVerificationDialog(); /* This loads up the dialog with form data */
if (('#form').valid()){
$('verification_dialog').dialog('open');
return false;
}
});
My dialog window is not displaying. It just submits the form. And I've verified that the form is valid by using an alert that checks the value of $('#form').valid()
If I remove the if statement and just have the line that opens the dialog, the dialog displays. However, it will display even if the form has errors which is what I'm trying to prevent.