From 187bef9f6ce1263da21f72e91f79192847273ba7 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 31 Jan 2020 17:26:39 +0100 Subject: luci-base: validation.js: fix integer and float type validation Signed-off-by: Jo-Philipp Wich --- modules/luci-base/htdocs/luci-static/resources/validation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/luci-base/htdocs/luci-static') diff --git a/modules/luci-base/htdocs/luci-static/resources/validation.js b/modules/luci-base/htdocs/luci-static/resources/validation.js index dbf30488c1..0544e2f680 100644 --- a/modules/luci-base/htdocs/luci-static/resources/validation.js +++ b/modules/luci-base/htdocs/luci-static/resources/validation.js @@ -221,7 +221,7 @@ var ValidatorFactory = L.Class.extend({ types: { integer: function() { - return this.assert(this.factory.parseInteger(this.value) !== NaN, _('valid integer value')); + return this.assert(!isNaN(this.factory.parseInteger(this.value)), _('valid integer value')); }, uinteger: function() { @@ -229,7 +229,7 @@ var ValidatorFactory = L.Class.extend({ }, float: function() { - return this.assert(this.factory.parseDecimal(this.value) !== NaN, _('valid decimal value')); + return this.assert(!isNaN(this.factory.parseDecimal(this.value)), _('valid decimal value')); }, ufloat: function() { -- cgit v1.2.3