For selecting date and time, HTML5 has several new input types:
<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
- 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)
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"
Great article. Useful information. Thanks for Posting.
ReplyDeletehttp://www.cavinitsolutions.com/