Using the input Element to Restrict Data Entry
HTML5 introduces new values for the input element's type attribute. Those values let you be more specific about the kind of data that you want from the user.
The following table lists those values:
Type | Restricts the input to | New in HTML5 |
---|---|---|
checkbox | to a true/false check box. | No |
color | a color. | Yes |
date | a date. | Yes |
datetime | a global date and time with time zone. | Yes |
datetime-local | a global date and time without time zone. | Yes |
a properly formatted e-mail address. | Yes | |
month | a year and month. | Yes |
number | an integer or floating-point number. | Yes |
radiobutton | a fixed set of choices. | No |
range | a specified range. | Yes |
tel | a properly formatted telephone number. | Yes |
time | a time of day. | Yes |
week | a year and week. | Yes |
url | a fully qualified URL. | Yes |
Home
HTML CSS Book
HTML
HTML CSS Book
HTML
input Restricted:
- Using the input Element to Restrict Data Entry
- Using the input element to obtain a number
- Using input Element to Obtain a Number in a Given Range
- Using the input Element to Obtain a Boolean Response
- Using the input Element to Create Fixed Choices
- Using the input Element to Obtain email address
- Using the input element to obtain telephone number
- Using the input Element to Obtain url
- Using the input element to obtain times and dates
- Using the input Element to Obtain a Color
- Using the input Element to Obtain Search Terms
- Using the input element to create hidden data items
- Using the input Element to Create Image Buttons and Maps
- Using the input element to upload files
Related: