Form validation is one of the primary reasons to use client-side JavaScript. It can prevent user entry errors before your app attempts to submit data to the server. But… client-side validation is not a substitute for server-side validation! Always check incoming user data on the server. Not every request will come from a browser nor will every browser run validation code. Client-side validation is
![Form Validation Using JavaScript's Constraint Validation API](https://cdn-ak-scissors.b.st-hatena.com/image/square/39ac71fe185240aa3d33b48e2e96cc32e71fbbb7/height=288;version=1;width=512/https%3A%2F%2Fblog.openreplay.com%2Fstatic%2F553720b0941272b93be32ffd06e7e674%2F6050d%2Fhero.png)