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

Buggy behavior when specifying invalid rules/methods #1212

Closed
joshribakoff opened this issue Jul 18, 2014 · 2 comments
Closed

Buggy behavior when specifying invalid rules/methods #1212

joshribakoff opened this issue Jul 18, 2014 · 2 comments

Comments

@joshribakoff
Copy link

If you put a typo in your rules like accidentally putting:

rules: {
  myField: { require:true }
}

Instead of putting:

rules: {
  myField: { required:true }
}

You will observe undefined behavior. Obscure stack traces about calling .call() on undefined, and forms submitting even though they are invalid.

If I put a typo, I would expect an exception that says "the rule 'require' for the element 'myField' has no corresponding method" and for the field to be marked as invalid & prevent submission.

In debugging this, it seems to confuse a lot of users. There are tons of unanswered questions on stack overflow stemming from this issue.

@GiuseppeMobijay
Copy link

It happen also on not found input name in the form.

rules: {
myFiel: {required:true}
}

@jzaefferer
Copy link
Collaborator

You can use the debug option to get better error messages on the console.

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

3 participants