Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么通过事件更改data-rule无效 #279

Open
pandelix opened this issue May 17, 2019 · 1 comment
Open

为什么通过事件更改data-rule无效 #279

pandelix opened this issue May 17, 2019 · 1 comment
Labels

Comments

@pandelix
Copy link

js里面写了
$('#xxx').on('click', function () {
$('#c-name').removeAttr("data-rule");
});
页面源码上的data-rule也确实移除了,但是提交时还是无法通过验证

@niceue
Copy link
Owner

niceue commented Feb 9, 2020

如果是要禁用一个字段的验证,不需要移除规则,只需要给 input 添加 HTML5 的 novalidate 属性。
如果实在要移除可以调用实例方法:setField
https://validator.niceue.com/docs/methods.html#section-3-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants