views:

23

answers:

1

I am using a Jquery UI modal form to post data back to my action and it works fine. However when I put client side validation on and the user closes the modal without submitting the form retains the validation messages and styles.

It there away to clear the validation messages on the client? What element is the message wrapped in?

A: 

You could use the .resetForm() function:

var validator = $("#myform").validate({
   ...
   ...
});

And later when you close the modal dialog:

validator.resetForm();
Darin Dimitrov
I believe this only works with the jquery form plugin ... which I am not using.
abarr
No, this is a `jQuery.validate` plugin method and it has no relation to the `jQuery.form` plugin.
Darin Dimitrov