HTML and CSS Reference
In-Depth Information
The week input type
<input type=week>
allows entry and validation of a week number.
While this could be a simple input fi eld allowing a user to input
a number, it's more complex in practice: some years have 53
weeks. Therefore, the format is 2010-W07 for the seventh week
in the year 2010.
Opera offers a datepicker UI, which populates the input field
with the week number of any selected date rather than the
dates YYYY-MM-DD format (
Figure 3.5
).
FIGURE 3.5
Opera
10.50's rendering of
<input type=week>
.
The number input type
The
number
input type throws an error if the user does not enter
numeric characters, unsurprisingly. It works perfectly with the
min
,
max
, and
step
attributes. In Opera, it is rendered as a spinner con-
trol that will not go beyond the upper and lower limits (if speci-
fied) and which progresses by the increment specified in
step
,
although a user can also type the value (
Figure 3.6
).
FIGURE 3.6
Opera
10.50's rendering of
<input type=number>
.
The range input type
<input type=range>
renders as a slider.
Figure 3.7
shows it in
Google Chrome.
FIGURE 3.7
Google
Chrome's rendering of
<input type=range>
.