An Interest In:
Web News this Week
- April 29, 2024
- April 28, 2024
- April 27, 2024
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
June 27, 2017 12:11 pm GMT
Original Link: https://css-tricks.com/form-validation-part-2-constraint-validation-api-javascript/
Form Validation Part 2: The Constraint Validation API (JavaScript)
In my last article, I showed you how to use native browser form validation through a combination of semantic input types (for example, <input type="email">
) and validation attributes (such as required
and pattern
).
While incredibly easy and super lightweight, this approach does have a few shortcomings.
- You can style fields that have errors on them with the
:invalid
pseudo-selector, but you can't style the error messages themselves. - Behavior is also inconsistent across browsers.
User studies from Christian Holst…
Form Validation Part 2: The Constraint Validation API (JavaScript) is a post from CSS-Tricks
Original Link: https://css-tricks.com/form-validation-part-2-constraint-validation-api-javascript/
Share this article:
Tweet
View Full Article