Get the latest tech news

HTML Form Validation is underused


HTML Forms have powerful validation mechanisms, but they are heavily underused. In fact, not many people even know much about them. Is this because of some flaw in their design? Let’s explore.

The fact that setCustomValidity API is exposed only as a method and doesn’t have an attribute equivalent leads to some terrible ergonomics. Next, we’ll create a controlled form component and use react-query to manage to server request when the input value changes: Verification request state managed by useQuery Our custom<Input /> component that is capable of taking the customValidity prop

Get the Android app

Or read this on Hacker News

Read more on:

Photo of HTML Form Validation

HTML Form Validation