I need to remove the jquery validation messages from a modal form
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 a开发者_StackOverflow社区nd 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?
You could use the .resetForm()
function:
var validator = $("#myform").validate({
...
...
});
And later when you close the modal dialog:
validator.resetForm();
精彩评论