HTML - Form Validation
Table of Contents
1 - About
form validation.
2 - Articles Related
3 - List of validation rules
- required
- min
- max
- minLength
- maxLength
- pattern
- validate
4 - Limitations
HTML validation has its limitations.
- it only works in the browser (not React Native, …)
- it's hard/impossible to show custom error messages to our user.
5 - Function
- form.checkValidity() - Returns true if the form's controls are all valid; otherwise, returns false.
- form.reportValidity() - Returns true if the form's controls are all valid; otherwise, returns false and informs the user.