From: Jo-Philipp Wich Date: Fri, 31 Jan 2020 16:26:39 +0000 (+0100) Subject: luci-base: validation.js: fix integer and float type validation X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=187bef9f6ce1263da21f72e91f79192847273ba7;p=oweals%2Fluci.git luci-base: validation.js: fix integer and float type validation Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/validation.js b/modules/luci-base/htdocs/luci-static/resources/validation.js index dbf30488c..0544e2f68 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() {