From ab2fb1bf8516b63e135deed5a71fde786b17c628 Mon Sep 17 00:00:00 2001 From: Vladislav Hejda Date: Tue, 27 Sep 2016 00:28:01 +0200 Subject: [PATCH] netteForms.js: cannot use range() to validate min/max (#136) --- src/assets/netteForms.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/netteForms.js b/src/assets/netteForms.js index 925809670..62ecc97e7 100644 --- a/src/assets/netteForms.js +++ b/src/assets/netteForms.js @@ -480,7 +480,7 @@ Nette.validators = { return null; } } - return Nette.validators.range(elem, [arg, null], val); + return arg === null || parseFloat(val) >= arg; }, max: function(elem, arg, val) { @@ -491,7 +491,7 @@ Nette.validators = { return null; } } - return Nette.validators.range(elem, [null, arg], val); + return arg === null || parseFloat(val) <= arg; }, range: function(elem, arg, val) {