January 14, 2012

HTML5, the input element, the type attribute, and the date state

For the HTML5 input element, setting the type attribute to the date state forces any selected date to use the YYYY-MM-DD format, as determined by the W3C.  It also goes on to say that "The format shown to the user is independent of the format used for form submission. Browsers are encouraged to use user interfaces that present dates and times according to the conventions of the user's preferred locale."

I've only tested this with Opera, which has the date show up in the YYYY-MM-DD format.  I think this is disappointing from a usability standpoint.  I'm not thrilled about the idea of having to code for different date formats either.  I would love to see browser makers focus on implementing all HTML5 form features, particularly since forms are what really drive the Internet to be useful.  I would mind somehow seeing the pattern attribute have some standard values for regularly used types of data collected (zip codes, phone numbers, etc.) instead of having to create or find regular expressions and hope that you have covered all valid possibilities.
Post a Comment