HTML and CSS Reference
In-Depth Information
When entering text into a telephone field, many touchscreen smartphones will automatically invoke a
numeric keypad—as you can see in Figure 8-7—instead of their usual onscreen keyboard. Otherwise a
telephone input behaves just like a text input, and desktop browsers may not give them any special
treatment at all (at least not yet; even less-mobile desktop and laptop computers can access telephone
networks electronically, so future desktop browsers could certainly support telephone inputs).
Figure 8-7. A telephone input invokes a numeric keypad in some mobile browsers, such as the iPhone's Mobile Safari
on the left and Firefox for Android on the right.
Dates and Times
Like phone numbers, dates and times can be written many different ways: “19th of June, 1996”, “May 22”,
“10/24/1999”, “2012-Mar-3”, “4:15pm”, “09:44:16 PST”, “quarter past midnight on the autumnal equinox”…
the variations are endless. But web apps and databases tend to be very particular and require a
consistent, machine-readable format so they can accurately handle dates and times. It's always been
difficult to impose a standard date or time format on web users, and for years developers have made use
of JavaScript calendar widgets or forced users to step through multiple text fields or dropdown menus to
enter a year, month, and day separately. HTML5 makes a web developer's—and a web user's—life a little
bit easier with a number of input types built especially for collecting date and time data.
input type="date" : For a complete date comprising a year, month, and day. Example: 2012-
input type="datetime" : For year, month, day, hours, minutes, and coordinated universal time
zone (UTC). Example: 2012-07-22T08:45Z
Search WWH ::

Custom Search