Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用jQuery 验证引擎来验证我的表单。模式框验证正在工作,但是当我关闭模式框验证消息时,页面上仍保留原样。
我怎样才能删除它们?
您在哪里显示验证消息?您应该在模态框本身上显示验证消息,以便在框关闭时它会熄灭。
一般的答案,没有任何代码,是从模式关闭的回调中手动从表单中删除验证元素。
像这样的东西:
$(".cancel").click(function() { validator.resetForm(); )};
将您的模态链接到取消功能附近。