Skip to content

Commit d713533

Browse files
VladaHejdadg
authored andcommitted
netteForms.js: cannot use range() to validate min/max (#136)
1 parent fce5b4d commit d713533

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/assets/netteForms.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ Nette.validators = {
425425
return null;
426426
}
427427
}
428-
return Nette.validators.range(elem, [arg, null], val);
428+
return arg === null || parseFloat(val) >= arg;
429429
},
430430

431431
max: function(elem, arg, val) {
@@ -436,7 +436,7 @@ Nette.validators = {
436436
return null;
437437
}
438438
}
439-
return Nette.validators.range(elem, [null, arg], val);
439+
return arg === null || parseFloat(val) <= arg;
440440
},
441441

442442
range: function(elem, arg, val) {

0 commit comments

Comments
 (0)