Subscribe to Sergio Tapia - Lost in the GC.        RSS Feed
-----

The not-so-new HTML input date. So lean, so clean.

Icon 1 Comments
When you're a web developer, most companies ask you to create some input forms, and more often than not you're required to ask the user for a date input.

Posted Image

The above element was created using the most excellent jQueryUI datepicker widget. Usage is simple:

$('input[name="dateofbirth"]').datepicker();


It's small, lean and since you are probably already using jQuery the overhead is minimal. But still, this should be something that's built in, correct?

And it turns out that there is in fact an HTML element that's build for this purpose. Baked right into the browser!

Firefox users you're out of luck as of 11.0
Google Chrome users you're out of luck as of 18.0
Opera users, once again your browser of choice is a pioneer leading the way.

It's a shame this browser isn't getting more market share it's blazing fast, very light and it has never once crashed on me in the 7 years I've been using it.

Let's see the input type="date" element in action:

<input type="date" min="1989-08-09" max="2012-12-0" value="2010-05-15"/>


Save the markup in a regular html file and open it using the latest version of Opera.

Posted Image

Works exactly as you would expect from a modern calendar select widget and it's very lightweight coming down the wire.

You can even style it as you please. (More or less, more on that later)

I would love to see more browsers update to implement correct standards, it would be so exciting! And in that regard, I applaud Chrome for automatically upgrading without letting users know what version they are running. Chrome users more often than not are just running the cutting edge latest version of their browsers whereas I know some people still rocking Firefox 3.

1 Comments On This Entry

Page 1 of 1

Shane Hudson Icon

17 April 2012 - 11:58 AM
Chrome has it as of today but you are defintely right that Opera is very good at some things. I prefer chrome but would rate Opera over Safari!
0
Page 1 of 1

Trackbacks for this entry [ Trackback URL ]

There are no Trackbacks for this entry

9 user(s) viewing

9 Guests
0 member(s)
0 anonymous member(s)

About Me

Posted Image


Bienvenidos! I'm a USA ex-pat living in Bolivia for the past 10 years. Web development is my forte with a heavy lean for usability and optimization. I'm fluent in both English and Spanish. I guest write for the popular Python website Python Central. Visit my website.

Categories