Constraint Validation API Playground

The teacher marks your sign-up form for the coding contest: required, pattern and min work for real, the browser’s ValidityState and validationMessage are on…

Why it matters

Many people rewrite validation the browser gives for free, and end up with less coverage and no translations. Read validity and validationMessage, use setCustomValidity for the remaining rules, and remember: the server must still check again.

The key idea

Validation is already in the browser, you only read it

Common mistakes

Try it in this playground