HTML and CSS Reference
In-Depth Information
Along with form validation, HTML5-compliant browsers also include native data types such as date, color,
e-mail, URL, and phone number form tags all with the necessary client-side validation, as you just learned in the
previous example. Let's take a look at working with each of them respectively. First up,
date
.
date
is where the browser can include a calendar picker element for a user by default in the browser's UI.
Figure
11-6
showcases how the browser Chrome handles
<input type="date"></input>
.
Figure 11-6.
How the Chrome browser handles the date input
Next is the color input. Using
<input type="color"></input>
, you can tell the browser to show a color wheel
for a user to select a hex value, as shown in Figure
11-7
. Please note that not all browsers handle each of these inputs.
Browsers will have their own visual differences for UI elements as well.