luci-base: validation.js: fix integer and float type validation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
7bc338c011
commit
187bef9f6c
1 changed files with 2 additions and 2 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue