Thursday 29 December 2011

HTML5 Input Type - Date Pickers

 For selecting date and time, HTML5 has several new input types:
  • date - Selects date, month and year
  • month - Selects month and year
  • week - Selects week and year
  • time - Selects time (hour and minute)
  • datetime - Selects time, date, month and year (UTC time)
  • date time-local- Selects time, date, month and year (local time)
 select a date from a calendar:

Syntax:

Date: <input type="date" name="user_date" />

Example:

 <!DOCTYPE html>
<html>
<body>

<form action="demo_form.asp" method="get">
Date: <input type="date" name="user_date" />
<input type="submit" />
</form>

</body>
</html>

 select  the below input type from a calendar
  • Input type "month":
  • Input type "week"
  • Input type "time":
  • Input type "datetime"
  • Input type "datetime-local"

1 comment:

  1. Great article. Useful information. Thanks for Posting.
    http://www.cavinitsolutions.com/

    ReplyDelete