Closed martonl closed 11 years ago
Is this a bug report for a plugin? Go file it on the plugin... Wait, I see you already have... https://github.com/jzaefferer/jquery-validation/issues/626#issuecomment-13339617
yes, after this issue, I found better place for it. Sorry!
Hi All,
I found a bug in Jquery Validation 1.11 Range validation method. This line is buggy:
return this.optional(element) || ( value >= param[0] && value <= param[1] );
Because this line checks strings, not numbers. If I have a range between 30 and 200, and I want to validate 120, then the string 120 is lesser then string 30.
This line must be something like this:
return this.optional(element) || ( Number(value) >= Number(param[0]) && Number(value) <= Number(param[1]) );