Jason Moon's Fool-Proof Date Input Script (with calendar)

Monday 25th of September 2017 04:56:27 PM
Contact Jason Visit Jason's Site

Called with the "DateInput" function. Parameters are:

  1. DateName - STRING - name of the hidden form element to store the selected, formatted date
  2. Required - BOOLEAN - optional; default = FALSE
  3. DateFormat - STRING - optional
  4. DefaultDate - STRING - optional; default = current system date from the client PC
Birthday:
 
* required
Called like this: DateInput('birth_date', true, 'DD-MON-YYYY', '01-AUG-1976')
 
 
Anniversary:
 
Called like this: DateInput('anniversary', false, 'DD-MON-YYYY', '28-JUN-2003')
 
 
Some Date:
 
Called like this: DateInput('some_date', false, 'DD-MON-YY')
 
 
Today:
 
Called like this: DateInput('today', true)
 

Supported date formats:

* Can specify a 2-digit year


Customizable variables:


View the JavaScript source! set a single background image so that it's hanging off the page, you're probably better off producing an image that is already cut off and just putting it in the top left corner.

Throughout this section, every example has had a repeat value of no-repeat. The reason for this is simple: with only a single background image, it's much easier to see how positioning affects the placement of the first background image. We don't have to prevent the background image from repeating,

Thanks to background-repeat, it's possible to place a large image in the background of a document, and then keep it from repeating. Let's add to that and actually change the image's position in the background.

background-position

WARNING

forget to declare a border style. This leads to all kinds of authorfrustration because at first glance, the styles appear correct. Theresult, though, is a paragraph with no border:

P {margin: 5px; border-width: 20px;}

Since the default value of border-style isnone, failure to declare a style is exactly thesame as declaring border-style:none. Therefore, if you want a border to appear,you need to pick a style and declare it.