4 ms·
> Using other input attributes that create constraints, such as "pattern" or "maxlength" No. Don't use the maxlength attribute. https://adamsilver.io/blog/don
by yakshaving_jgt 2y ago
> Using other input attributes that create constraints, such as "pattern" or "maxlength"
No. Don't use the maxlength attribute.
https://adamsilver.io/blog/dont-use-the-maxlength-attribute-to-stop-users-from-exceeding-the-limit/ https://adamsilver.io/blog/dont-use-the-maxlength-attribute-...
- everdimension 2y agoThat's great advice! I also dislike the "character rejection" mechanisms, even though many people love it and products often ask to implement it. To add to the possible solutions mentioned in your article, I'd add the "pattern" attribute. You can do something like this: <input pattern=".{0,6}" /> This will allow input of any length, but show a warning then the value is longer than six characters.