Permalink
Browse files

fixing min_length, max_length, and exact_length validators

  • Loading branch information...
1 parent 9403051 commit a508eaa33a109848b0522798cdb4e856c4614962 @AlanHietala AlanHietala committed Feb 10, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 validate.js
View
6 validate.js
@@ -306,23 +306,23 @@
return false;
}
- return (field.value.length >= length);
+ return (field.value.length >= parseInt(length, 10));
},
max_length: function(field, length) {
if (!numericRegex.test(length)) {
return false;
}
- return (field.value.length <= length);
+ return (field.value.length <= parseInt(length, 10));
},
exact_length: function(field, length) {
if (!numericRegex.test(length)) {
return false;
}
- return (field.value.length === length);
+ return (field.value.length === parseInt(length, 10));
},
greater_than: function(field, param) {

0 comments on commit a508eaa

Please sign in to comment.