1. Home
  2. Computing & Technology
  3. JavaScript

Date Selector

1. Introduction and Sample

clr gif
More of this Feature

The Script Add to Form

Do you want to provide an easy way for your visitors to enter dates into your form? What about displaying a calendar directly under the date input field and allowing your visitors to select the date from there if they don't want to type it in themselves.

Here is an example (I've just put the date field itself into this form but you can add as many other fields as you want in your forms).

You can either type directly into the input field or click on a date in the calendar to load that date into the form field. The arrow links under the calendar allow you to change the displayed calendar by one month or one year in either direction each time you select them. Any month between 1901 and 2099 can be displayed. If your visitor's browser doesn't support Javascript then the calendar doesn't display but the date field is still available for input.

If you like the idea of being able to enter dates this way then the first step in adding it to your form is to obtain the script.

Introduction | The Script | Add to Form
Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.