如何告诉 parsley-Instance 排除不可见的表单元素?
我在文档中找到了这个:data-parsley-excluded="input[type=button], input[type=submit], input[type=reset], input[type=hidden], [disabled], :hidden"
但我现在不知道在哪里设置这个选项?如何将此选项解析为构造函数?
更多信息:我正在使用 jQuery("#formid").parsley();
将欧芹绑定(bind)到我的表单上
非常感谢。
问候
最佳答案
要么做:
jQuery("#formid").parsley({ excluded: "input[type=button], input[type=submit], input[type=reset], input[type=hidden], [disabled], :hidden" });
或者
window.ParsleyConfig = { excluded: "input[type=button], input[type=submit], input[type=reset], input[type=hidden], [disabled], :hidden" };
<script src="parsley.js"></script>
(见 http://parsleyjs.org/doc/index.html#psly-usage-global-configuration)
关于parsley.js - 使用 parsley.js 2.x 排除不可见的输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22914564/