Using Input Validation

HTML5 introduces support for input validation. The support is rudimentary and inconsistent across browsers.

Support for Input Validation

Validation AttributeSupported Elements
requiredtextarea, select, input (the text, password, checkbox, radio, file, datetime, datetime-local, date, month, time, week, number, email, url, search, and tel types)
min, maxinput (the datetime, datetime-local, date, month, time, week, number, and range types)
patterninput (the text, password, email, url, search, and tel types)
Home 
  HTML CSS Book 
    HTML  

Input Validation:
  1. Using Input Validation
  2. Ensuring the User Provides a Value
  3. Ensuring a Value Is Within Bounds
  4. Ensuring a Value Matches a Pattern
  5. Ensuring a Value Is an E-mail Address or URL
  6. Disabling Input Validation
Related: