JAVASCRIPT CALENDAR POPUP

Use this calendar popup to help your users select proper dates in your forms.  To implement this popup, simply add a text field, a link (with associated JavaScript code), and an image to your document and ensure that "calendar.html" and "calendar.gif" are both available in the directory.  You may want to additionally use Eric Krock's Form Validation routines (specifically checkDate()) for validating any dates the user enters.

In the example below, click on the calendar icon to launch the calendar popup window and select a date.  The popup window will then close and your date will appear in the text field.  Try it now:
 

Enter Date:   Popup Calendar 
 

Here is the code for the above example:

<FORM NAME=inputForm METHOD=POST>
<B>Enter Date:&nbsp;</B>
<INPUT TYPE=TEXT VALUE="MM/DD/YYYY" NAME=DATE1 SIZE=10>
<A HREF="#" onClick="window.dateField = document.inputForm.DATE1;calendar = window.open('calendar.html','cal','WIDTH=200,HEIGHT=250')"><IMG SRC="calendar.gif" BORDER=0></A>
</FORM>

 The key line of code is "onClick="window.dateField = document.inputForm.DATE1;" ... simply change "inputForm" to the name of your form and "DATE1" to the name of your date field to enable the popup in your own forms.


Copyright © 1997 Netscape Communications Corporation