News for hackers. Stuff that matters.
Re:The number input is the worst input by runarberg on Friday September 16, 2022 @01:00PM (#32868964)
It is supported by all modern browsers. Even IE-11 supports valueAsNumber and the most important Constraint Validation API methods to deal with the problems the author mentions.

If you want to deal with inconsistent (and possible eccentric) user input: Use input.valueAsNumber

If you want to distinguish between empty and invalid inputs: Use input.validity.valid or input.validity.badInput

If you want to programmatically deal with incorrect entries: Again use the constraint validation API.

There are no comments on this comment yet.