views:

20

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 and styles in JS on the client?

+1  A: 

Use the "close" event to remove classes or styles etc

$('.selector').dialog({
    close: function(event, ui) {
       $('.selector').css('property',''); // sets a style property to nothing
       // or maybe
       if($('.selector').hasClass('classname'))
       {
           $('.selector').removeClass('classname'); // removes a class from the selector
       }
    }
});
Mark
The main thing I need to do is remove the validation message. I was able to use your suggestion and get it working. Thanks.
abarr