clientcide icon indicating copy to clipboard operation
clientcide copied to clipboard

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

Open ableeda opened this issue 13 years ago • 1 comments

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 avatar Jan 19 '12 01:01 ableeda

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.

ableeda avatar Jan 19 '12 08:01 ableeda