简体   繁体   中英

Validation error messages remain on page while closing modal box

I am using jQuery Validation Engine to validate my form. On modal box validations are working, but when I close the modal box validation messages are remaining on page as it is.

How can I remove them?

Where are you showing the validation messages? You should show the validation messages on the modal box itself, so that it will go off when the box is closed.

一般的答案是,无需任何代码,是从模式关闭的回调中手动从表单中删除验证元素。

Something like this:

$(".cancel").click(function() {
validator.resetForm();
)};

link your modal close to a cancel function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM