5 ms·
FYI, there's a few features available with the number input type that don't work with this method. Things like min, max and step attributes.
by calibas 7y ago
FYI, there's a few features available with the number input type that don't work with this method. Things like min, max and step attributes.
- eat_veggies 7y agomin, max, and step don't make sense for things like account numbers or credit cards!
- calibas 7y agoWell yes, in those cases it doesn't make sense, but the article mentions things like date fields, where you might want a min of 1 and a max of 31. It can also make sense to use step="0.1" if you need value to include tenths. Just saying there's advantages and disadvantages to each approach. I do agree with the article, their approach is better in most cases.
- rocqua 7y agoIn fact, the article does recommend using 'numeric' for dates!
- ulucs 7y agoI'm just being cheeky, but you can abuse the pattern field to enforce minimums ans maximums