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

Form.Validator.Tips is only respecting the last validation rule for a given input #86

Open
ableeda opened this issue Jan 19, 2012 · 1 comment

Comments

@ableeda
Copy link

ableeda commented Jan 19, 2012

For example, if an input has validate-alphanum followed by maxLength:10 validators. Validation will pass for non-alphanumeric inputs that aren't longer than 10 characters. If the order of the validators is reversed, the opposite behavior applies. In that case, validation would pass for anything alphanumeric, regardless of character length.

Examples:

Form.Validator.Tips with validate-alphanum first: http://jsfiddle.net/LdFfA/9/
Form.Validator.Tips with validate-alphanum second http://jsfiddle.net/LdFfA/15/
Form.Validator.Inline working correctly: http://jsfiddle.net/LdFfA/14/

@ableeda
Copy link
Author

ableeda commented Jan 19, 2012

My very wise coworker (https://github.com/mooyah) came up with this solution - http://jsfiddle.net/LdFfA/24/

From what I can tell it works like a charm.

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