简体   繁体   English

添加错误/删除jquery.validate中的错误

[英]adding an error / removing an error in jquery.validate

I'm trying to implement a generic way of adding remote validation to xVal / jquery.validate 我正在尝试实现将远程验证添加到xVal / jquery.validate的通用方法

There are only two unsolved questions left: 只剩下两个未解决的问题:

  • How do I "manually" mark a form element as invalid and add an error message to it from my own javascript code? 如何“手动”将表单元素标记为无效,并通过自己的JavaScript代码向其中添加错误消息?

  • How do I remove remove the error message at a later time without removing any other error messages? 如何在以后删除而不删除其他错误消息的情况下删除该错误消息?

Is there any neat way to do this or do I have to hack a solution that takes into account how jquery.validate works internally? 有什么整洁的方法可以做到这一点,还是我必须破解一个考虑到jquery.validate在内部如何工作的解决方案?

我找到了一种解决此问题的更好方法,并写了一篇博客文章,介绍了如何以通用方式实现远程客户端验证 ,以防其他人也对远程客户端验证感兴趣。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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