Problem: Started in a Focal Point post, the question is, how to validate Date (calendar) controls in a guided ad-hoc HTML page?
There have been so many problems with users not entering the date in mm/dd/yyyy, even when specifically stated on the screen.
When setting a date, without specifying the time zone, Java Script will use the browser's time zone.
When getting a date, without specifying the time zone, the result is converted to the browser's time zone.
options can be either a date string in the format of YYYY-MM-DD or a Date object.
If the form need to validate start and end date, you should take a look at the Validating fields that depend on each other or Compraing dates example.
Do not write anything (empty input): authors we are placed among the top Web resources and development sites around.
Constantly being on the lookout for partners; we encourage you to join us.
Remember that your code shall be as clean as possible.
Description: This script validates a date field to ensure it's in the format mm/dd/yyyy.
It also intelligently checks that the date ranges are valid, so something like 02/30/2005 is caught.
When capturing information for insertion into a database, or use in other processing, it's important to control what the user can enter.