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…
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.
Validation is already in the browser, you only read it
required/type/pattern/min already work. Read validity and validationMessage instead of your own regex.setCustomValidity('') A non-empty message = invalid forever. Set '' once it is right again, or the field stays red and the form cannot be sent.novalidate in DevTools or send the request directly. Client validation is only UX; the server must check again.minlength does not reject a value set from code tooShort/tooLong are only checked after the user has typed in that field. A value from el.value = … passes until someone types.@ type="email" lights up typeMismatch and validationMessage shows up in your browser’s language. There is no regex in our code.pattern rejects it: patternMismatch.invalid at every failing field, focuses the first, and sends no submit.setCustomValidity lights up customError, a rule no attribute can express.