1. Technology

<input type="date">

By

input type=date in Opera

input type=date in Opera

Screen shot by J Kyrnin

INPUT Date Description:

The date INPUT tag gives you a way to request dates in your web form. The date will be collected with the year, month, and day with no time zone. The browser or user agent should display a calendar or other date control input device to allow users to submit dates.

DTD: HTML5: <!doctype html>

INPUT Date Web Browser Support:

At this time, only Opera 9+ supports the INPUT date type with a calendar (see screen shot above). All other browsers display a text box. You can still use this input type, you will just have to validate that the contents are a date with a script or CGI.

HTML Versions

INPUT Date Attributes:

Global attributes, event attributes, and the input tag attributes. Plus: </p>

  • autocomplete
  • list
  • max
  • min
  • readonly
  • required
  • step
  • valueAsNumber
  • selectedOption
  • stepDown()
  • stepUp()

INPUT Date Usage:

Standard date input tag

<form>
<input type="date" value="2010-12-16;">
</form>

See an example of a standard date input tag.

INPUT Date Special Notes:

The input date tag is only supported in Opera 9+ if you want a calendar displayed, but you can still use this input type and validate that the submitted data is a date. That way, when other browsers do start supporting it, your forms won't have to be modified.

More INPUT Date Information:

©2014 About.com. All rights reserved.