by benjaminjosephw · 4y ago · 0 comments
> A simple way of determining whether to use type=number is to consider whether it would make sense for the input control to have a spinbox interface (e.g. with "up" and "down" arrows). Getting a credit card number wrong by 1 in the last digit isn't a minor mistake, it's as wrong as getting every digit incorrect. So it would not make sense for the user to select a credit card number using "up" and "down" buttons.
I don't think browsers can infer the semantic intent enough for this to be a fixable problem without some distinction in syntax.
I never used those except for testing to see what they do. They are always useless to me.
This happens to me accidentally while scrolling. Then I order the wrong quantity and such.
That said, I feel like the organizations behind HTML gave up too fast; they should have continued with input types for phone numbers (that e.g. phone manufacturers could then integrate with contacts without revealing anything to the website in question), credit card numbers (supporting all formats and with built-in format validation), etc. But they seem to have stopped 10+ years ago with HTML5's broken number input.