It used to be that you had to enter in a date in a very specific format, like mm/dd/yy or Month day, year. But very often, a user will enter a date into a field in a way that you didn’t expect, and that can be a problem for your code.
More importantly, there are several different and very elegant pieces of code already developed by other coders, at least one of which will be perfect for you.
There are two versions of this date picker: one mini and one regular size. This date picker is skinnable, so you can easily change how it looks on your page. Skins include Basic, Vista, OSX and JQuery.
jQuery Date Picker
The jQuery UI Datepicker is a highly configurable plugin that adds datepicker functionality to your pages. You can customize the date format and language, restrict the selectable date ranges and add in buttons and other navigation options easily.
By default, the datepicker calendar opens in a small overlay onFocus and closes automatically onBlur or when a date is selected. For an inline calendar, simply attach the datepicker to a div or span.
The jQuery date picker allows the user to use keyboard input, too. It’s a powerful, full featured piece of code.
Unobtrusive Datepicker Widget
Still, you can set multiple date formats and dividers, it’s fully skinnable with CSS, you can limit upper and lower date limits, and even disable certain specific dates.