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

下拉选框,在选择某个选项后才有出现某个必填的字段 #140

Closed
smallmacro opened this issue Jul 11, 2014 · 4 comments
Closed

Comments

@smallmacro
Copy link

有没有类似于:
rules: { //是否指定日期
isTimeDemand:function(element){
return $("#timeDemand").val() === "0";
},
这样自定义貌似不行。。哪里错了

@niceue
Copy link
Owner

niceue commented Jul 11, 2014

@smallmacro
返回true,则必填,返回false,则会跳过为空的验证

@smallmacro
Copy link
Author

嗯嗯,按道理应该可以。在q群上你也肯定了,可是不知道为何验证还是会跳过去。再者,这个过程应该也是动态验证的吧。例如刚开始载入为true,我手工选择为false后,按道理应该也是可以的。
2014年7月11日 下午11:34于 "Jony" notifications@github.com写道:

返回true,则必填,返回false,则会跳过为空的验证


Reply to this email directly or view it on GitHub
#140 (comment).

@niceue
Copy link
Owner

niceue commented Jul 11, 2014

v0.8.0 的规则required还支持jQuery选择器 #137

@niceue
Copy link
Owner

niceue commented Jul 12, 2014

自定义required的验证条件,官网有例子:
http://niceue.com/validator/demo/custom-rule.php#example6

@niceue niceue closed this as completed Jul 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants