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

.isFormValid() 方法结果不准确 #196

Closed
niceue opened this Issue Oct 28, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@niceue
Copy link
Owner

niceue commented Oct 28, 2015

当表单中有多余字段时,即使全部字段通过,.isFormValid() 总是返回 undefined

@niceue niceue closed this in 3643071 Oct 28, 2015

@niceue niceue added this to the 0.8.1 milestone Nov 16, 2015

@niceue niceue added the bug label Nov 16, 2015

@terranc

This comment has been minimized.

Copy link

terranc commented May 5, 2016

貌似现在的版本依旧有这个问题,以下代码的me.isFormValid()总是返回undefined

$('form').validator({
        timely: 2,
        beforeSubmit: function(form) {
            var me = this;
            if(me.isFormValid() && $(form).hasClass('ajax_form')){
                form_submit.call(form);
                return false;
            }
        }
    });
@niceue

This comment has been minimized.

Copy link
Owner Author

niceue commented May 6, 2016

1、为什么要用 beforeSubmit 而不是 valid 呢?这个回调还没有开始验证,所以 isFormValid() 也没有用的
2、isFormValid 目前不是对外 API,而且只能判断结果,并不执行验证

@terranc

This comment has been minimized.

Copy link

terranc commented May 7, 2016

了解3q

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