November 2011
Intermediate to advanced
384 pages
13h 23m
English
You can use the date input type, new in HTML5, to restrict input fields to values formatted like a date string:
<input type='date' name='field' value='date'>
The type='date' attribute value activates the date-specific input options of the user’s web browser, if supported. If you assign value='date' to prepopulate the input field, the date format should match the yyyy-mm-dd format.
Other date-related input types are also available in HTML5: month, week, time, datetime, and datetime-local. The type='month' and type='week' input types are similar to type='date' in idea, except that they follow a yyyy-mm and yyyy-Www format. To clarify, the week syntax is four year digits, followed by a literal W and then two week digits, ...
Read now
Unlock full access