Skip to content

Commit

Permalink
netteForms.js: cannot use range() to validate min/max (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
VladaHejda authored and dg committed Sep 26, 2016
1 parent fce5b4d commit d713533
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/assets/netteForms.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ Nette.validators = {
return null;
}
}
return Nette.validators.range(elem, [arg, null], val);
return arg === null || parseFloat(val) >= arg;
},

max: function(elem, arg, val) {
Expand All @@ -436,7 +436,7 @@ Nette.validators = {
return null;
}
}
return Nette.validators.range(elem, [null, arg], val);
return arg === null || parseFloat(val) <= arg;
},

range: function(elem, arg, val) {
Expand Down

0 comments on commit d713533

Please sign in to comment.