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

当isValid方法传入回调时,就返回jQuery对象维持链式调用 #46

Closed
niceue opened this issue Sep 29, 2013 · 0 comments
Closed
Assignees
Milestone

Comments

@niceue
Copy link
Owner

niceue commented Sep 29, 2013

在之前版本中,如果表单中没有远程验证,可以直接使用$(“#form”).isValid()来判断表单是否验证通过。但是,如果表单中有远程验证,就必须使用回调方式了。

如果是回调方式,就维持jQuery对象链

example:

$('#formId').isValid(function(v){
    console.log(v ? '表单验证通过' : '表单验证不通过');
}).find("#email").isValid(function(v){
    console.log(v ? '邮箱验证通过' : '邮箱验证不通过');
});
@ghost ghost assigned niceue Sep 29, 2013
@niceue niceue closed this as completed in e714292 Oct 2, 2013
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

1 participant