www.gutterbucket.com

JavaScript Date Picker

This script allows you to provide a pop-up calendar that can be used to select a date and place it into a html form field. Try the demo below to see how it works.

Example Field 1: pick date     Example Field 2: pick date

How to use the script:

First download the .js file and include it in your page via a <SCRIPT> tag. Then make an <A> tag that calls the show_cal() function with a single string argument that describes the intended target textbox or variable. e.g.

<form name="form1">
<script language="JavaScript" src="date-picker.js" type="text/javascript"></script>
<input type="text" name="textbox">
<a href="javascript: show_cal('document.form1.textbox.value')">pick date</a>
</form>

Please note: at present the date is provided in MySQL format (yyyy-mm-dd). If you need it in an alternative format you can modify the format_date_field() function in the .js file using a text editor.

Download:

Version Comments Date Download
v1.02 - added "day of week" header. 2007-11-19 date-picker.js
v1.01 - Now supports multiple calendar windows.
- Fixed minor formatting bug.
- added format_date_field() helper function.
2006-05-26 removed
v1.00 First Release:
- Date is provided in MySQL format (yyyy-mm-dd) only.
- Calendar always opens on current month.
2005-01-03 removed

 


Copyright 2000-2007  Mark R Hives  -  All rights reserved