2 ms·
> Form validation should be built-in Have you used pattern attributes? https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern https://developer.
by theandrewbailey 6y ago
> Form validation should be built-in
Have you used pattern attributes?
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes...
- edoceo 6y agoand the :invalid css option (I like to just make the bottom border red, dashed)
- rafd 6y agoFYI now there’s also :user-invalid which waits for the user to blur out of the field before it indicates the validity.
- wilsonrocks 6y agoI know it uses JS but the customValidity stuff is pretty cool too!
- intergalplan 6y agoYes! That is definitely a big step in the right direction. It's usually enough to remove at least some of the JS burden on forms. I'm not sure how widespread its use is in practice, though.