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

规则required支持传入规则名,满足规则才验证 #63

Closed
niceue opened this Issue Oct 19, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@niceue
Copy link
Owner

niceue commented Oct 19, 2013

$("#form").validator({
    rules: {
        myCondition: function(element) {
            return $("#other").is(":checked");
        }
    },
    fields: {
        // 只有满足myCondition规则,才验证该字段不能为空
        name: "required(myCondition)"
    }
});

@ghost ghost assigned niceue Oct 19, 2013

niceue added a commit that referenced this issue Oct 20, 2013

@niceue niceue closed this Oct 20, 2013

niceue added a commit that referenced this issue Dec 13, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment