jQuery 验证忽略带有样式的元素
我正在使用 jQuery validate 进行客户端验证,并且我想忽略任何具有 style="display: none"
的元素,
$("#myform").validate({
ignore: "?"
});
在上述情况下我的选择器会是什么?
I am using jQuery validate for client side validation and I want to ignore any element that has the style="display: none"
$("#myform").validate({
ignore: "?"
});
What would my selector be for that in the above case?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
注意:从版本 1.9.0 开始,
ignore: ":hidden"
是默认选项,因此不必再显式设置。使用
:hidden
:更新:为了完整性,来自插件文档:
Note: As of version 1.9.0,
ignore: ":hidden"
is the default option, so it does not have to be set explicitly anymore.Use
:hidden
:Update: for completeness, from the plugin's documentation:
http://api.jquery.com/hidden-selector/
":隐藏”
就是您要寻找的内容。
我感觉这样可能会更好。
http://api.jquery.com/hidden-selector/
":hidden"
is what your looking for.
I feel this might be better.