开发者

I need to remove the jquery validation messages from a modal form

开发者 https://www.devze.com 2023-01-05 06:45 出处:网络
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 submittin

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();
0

精彩评论

暂无评论...
验证码 换一张
取 消