Leap Year Aware Date Entry Widget

I'm incensed that any web-application programmer would consider subjecting their end-users to a date-entry form which allows the entry of an invalid date, such as 'February 29, 2003', or 'April 31, 2003'. Forget about validating the date and having the user go back to correct his mistake - it's just plain poor practice to allow the wrong choice in the first place.

Some years ago, I had to code a date-entry web form element. I went hunting on the web. I wanted a selector for year, month, and date, with the proper number of days in a month, with leap years properly handled. I thought that this must be such a basic, common requirement that there would be dozens, perhaps hundreds of implementations to choose from.

Perhaps they are out there, but I haven't been able to find an existing solution, and apparently neither have my banks, or any of the dozens of elaborate, expensive, polished, and otherwise finely designed and crafted websites I visit that still subject me and millions of other users to this kind of bad UI design every day. Sigh.

So, here is what I came up with. I hope that this leap-year aware date-entry widget will find more common use out there.



You can shift-click here to download a sample page with the embedded JavaScript and form.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.