HTML5 input elements and their data formats
As a follow-up to my article on js5hf – an unobtrusive javascript method for converting text type inputs to HTML5 input types, I wanted to put together a simple example of the new HTML5 inputs to demonstrate the formats in which they output data. So…you can see my example of HTML5 input element data formats which is semi-interactive – you can enter data as you wish and view the output by submitting the form.
A summary of the output formats is (any constant elements e.g. the “W” in week inputs and the “T” in datetime inputs are bolded):
- Search: String
- Number: String/Number
- Range: String/Number
- Tel: Unsupported at present
- URL: String (Opera requires an absolute URL e.g. http://www.example.com)
- Email address: String (The Email address format checks performed are minimal to day the least)
- Date: YYYY-MM-DD
- Month: YYYY-MM
- Week: e.g. YYYY-WWW (e.g. 2010-04 is week 4 of 2010)
- Time: HH:II:SS (e.g. 23:59:59)
- Datetime: YYYY-MM-DDTHH:II:SS (e.g. 2010-04-25T23:59:59)
- Datetime-local: YYYY-MM-DDTHH:II:SS (e.g. 2010-04-25T23:59:59)
You can see a more complete specification of HTML5 input elements on w3.org.
| This entry was posted by Neil Craig on March 31, 2010 at 6:31 pm, and is filed under General Web-Development, HTML5. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |

about 1 year ago
Hi There,
I just wanted to comment that this is a very important subject. Html 5 form elements are very handy.
If you check out Jquery Tools you will see the best usage of them. My favorite the calander box.
YUI is great too for most of this stuff. But jquery tools. NOT jquery UI is my favorite. Hope this helps someone.