[html5] Placeholder attribute on date inputs and validation

Rob Crowther robertc at boogdesign.com
Wed Jun 2 15:15:10 PDT 2010

I notice from 4.10.7 that the placeholder attribute is not valid on any 
of the date input types, so this produces an error at html5.validator.nu:

  <label for="exin">An input:</label>
  <input id="exin" type="date" placeholder="2010-06-02">

However it works just fine in Chromium 6 and Firefox 4 nightlies, and 
Opera displays the date picker control [1].  Chromium does report the 
input type as being 'date' but Firefox still thinks it's 'text'.

My feeling is that if there are user agents that support the placeholder 
attribute but don't display any special UI for the date input type then 
using the placeholder to provide useful information to the user is 
perfectly acceptable.  Other than it not being valid, is there anything 
else I should be concerned about?


[1] http://www.boogdesign.com/examples/forms2/valid.html

More information about the Help mailing list