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

Prevent infinite loop validation #216

Closed
niceue opened this Issue Jan 26, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@niceue
Copy link
Owner

niceue commented Jan 26, 2016

The following code will cause an infinite loop:

$("#myForm").validator({
    valid: function(form){
        // some code
        $(form).submit();
    }
});

Because the .submit() method which trigger a "submit" event cause anthor validation call.

Using native submit is the right way:

$("#myForm").validator({
    valid: function(form){
        // some code
        form.submit();
    }
});

That's a problem, but we can fix it

😄

@niceue niceue added the improve label Jan 26, 2016

@niceue niceue added this to the 0.10.4 milestone Jan 26, 2016

niceue added a commit that referenced this issue Jan 26, 2016

@niceue niceue closed this Jan 26, 2016

niceue added a commit that referenced this issue Jan 26, 2016

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