Using Input Validation
HTML5 introduces support for input validation. The support is rudimentary and inconsistent across browsers.
Support for Input Validation
Validation Attribute | Supported Elements |
---|---|
required | textarea, select, input (the text, password, checkbox, radio, file, datetime, datetime-local, date, month, time, week, number, email, url, search, and tel types) |
min, max | input (the datetime, datetime-local, date, month, time, week, number, and range types) |
pattern | input (the text, password, email, url, search, and tel types) |
Home
HTML CSS Book
HTML
HTML CSS Book
HTML
Input Validation:
- Using Input Validation
- Ensuring the User Provides a Value
- Ensuring a Value Is Within Bounds
- Ensuring a Value Matches a Pattern
- Ensuring a Value Is an E-mail Address or URL
- Disabling Input Validation
Related: