We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
内置规则required又支持新语法啦,groups参数从此就废弃了。
required
<input class="contact" name="mobile" placeholder="手机号" data-rule="required(from, .contact);mobile" data-msg-required="请至少填写一种联系方式"> <input class="contact" name="tel" placeholder="电话" data-rule="required(from, .contact);tel"> <input class="contact" name="email" placeholder="邮箱" data-rule="required(from, .contact);email">
required(from, .className, count)
其中: 参数from是固定的,表示required需要执行多项验证; .className是这一组字段都有的className; 最后一个参数count是可选的(默认为1)
from
.className
count
只需要给组内第一个字段设置required的错误消息就可以了(可以是DOM传参或js传参)
The text was updated successfully, but these errors were encountered:
6fca492
Fixed #134
8e733d3
No branches or pull requests
内置规则
required
又支持新语法啦,groups参数从此就废弃了。怎样实现,多个字段至少填写一个?
使用规则:
required(from, .className, count)
其中:
参数
from
是固定的,表示required
需要执行多项验证;.className
是这一组字段都有的className;最后一个参数
count
是可选的(默认为1)只需要给组内第一个字段设置required的错误消息就可以了(可以是DOM传参或js传参)
The text was updated successfully, but these errors were encountered: