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

Saturday 21st of October 2017 01:03:58 AM
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
* required
Called like this: DateInput('birth_date', true, 'DD-MON-YYYY', '01-AUG-1976')
Called like this: DateInput('anniversary', false, 'DD-MON-YYYY', '28-JUN-2003')
Some Date:
Called like this: DateInput('some_date', false, 'DD-MON-YY')
Called like this: DateInput('today', true)

Supported date formats:


<list-style-type> || <list-style-image> || <list-style-position>

Figure 7-87

Figure 7-87. Bringing it all together

The values for list-style can be listed in any order, and any of them can be omitted. As long as one is present, the rest will fill in their default values. For instance, the following * Can specify a 2-digit year

Customizable variables:

View the JavaScript

There is one other way for a floated element to exceed itsparent's inner left and right edges, and that's when thefloated element is wider than its parent. In that case, the floatedelement will simply overrun the right or left inneredge -- depending on which way the element is floated -- in itsbest attempt to display itself correctly. This will lead to a resultlikethat