diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-01-31 17:26:39 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-01-31 17:26:57 +0100 |
commit | 187bef9f6ce1263da21f72e91f79192847273ba7 (patch) | |
tree | 02f9688b1e7c580952b87b69a4c9e8ec41ef3ab3 /modules/luci-base/htdocs | |
parent | 7bc338c011e497bf89c03cbf15a230247d5b0f20 (diff) |
luci-base: validation.js: fix integer and float type validation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/validation.js | 4 |
1 files changed, 2 insertions, 2 deletions
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() { |