Warning: The style sheet could not be loaded or your browser is not compatible with the latest standards.


Warning: This page requires JavaScript turned on.

Date field example

This is a test file to show how to create a date field simply by applying a CSS class to a standard input field (type="text"). Type, for example, "today" in a field and move focus away from the field (i.e hit the Tab key). Click the calendar button for the date picker.

View the source to see how it is done. Download the Zip archive

(mm/dd/yyyyy)

This is what I actually write in my JSP (using my custom tag library).

<html:text divClass="row rightcol" labelKey="label.customer.birthdate" 
                    property="customer.birthdate"  maxlength="40" accesskey="d" 
                    tabindex="10" styleClass="formfield date" /> 

Acknowlegements

Date picker
Mihai Bazon [ http://www.dynarch.com/projects/calendar/ ]
Magic Date parser
Simon Willison [ http://simon.incutio.com/archive/2003/10/06/betterDateInput ]
Stuart Langridge
Unobtrusive DHTML technique

Valid HTML 4.01!