Progressively Enhanced Form Validation, Part 4: Custom validation messages

Part 4 explores the ValidityState API, a powerful, approachable, and well-supported API we can use to define custom validation messages.
You appear to be offline, some content may be unavailable.
Part 4 explores the ValidityState API, a powerful, approachable, and well-supported API we can use to define custom validation messages.
Parts 1 and 2 of this series explore the browser's built-in HTML & CSS form validation features and how to progressively enhance the experience by layering in JavaScript. This article continues the exploration, focusing on a use case not handled natively: a checkbox group.
In Part 2 of this series, we take the base HTML and CSS form validation experience and progressively enhance it by adding JavaScript and the Constraint Validation API while also addressing accessibility concerns.
Browsers nowadays have built-in form validation features that make JavaScript-only solutions unnecessary. Let's explore what this might look like using progressive enhancement techniques.
Can our GIF-like embeds support playback controls, alternative text, and reduced motion?
Animated GIFs remain popular in spite of their beefy file sizes. But what are we supposed to use instead?
Using the native HTML disclosure widget for a burger menu is so enticing. Unfortunately, the details/summary elements come with accessibility issues, so it's not an inclusive solution.
Progressive enhancement or a great Cumulative Layout Shift metric score? Why not both?
By wrapping and enhancing HTML elements, we can provide a solid baseline experience, with progressive enhancement as the cherry on top.
One of the hidden benefits of Progressive Web Apps is that you can start right now and roll out features incrementally. We took this approach when building our own Progressive Web App last year. Our…