validate.js icon indicating copy to clipboard operation
validate.js copied to clipboard

input with [type="number"] has a non numeric value for `length`

Open FrDH opened this issue 5 years ago • 1 comments

Trying to apply the numericality validation on an input with [type="number"], but getting the error in the console:

myNumberField has a non numeric value for length

Meaning, the value should be converted into a string before trying to do .length on it.

FrDH avatar May 13 '20 06:05 FrDH

Could be fixed by adding .toString() to https://github.com/ansman/validate.js/blob/master/validate.js#L792

FrDH avatar May 20 '20 13:05 FrDH