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

Saturday 17th of March 2018 06:55:29 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
* 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:

* Can specify a 2-digit year

Customizable variables:

View the JavaScript
source! it's worth reviewing again, just to see how it operates.

7.5.2. Single-Side Padding

You guessed it: there are properties that let you set the padding on a single side of the box, without affecting the other sides.

background-repeat: no-repeat;} Real-world uses

The ability to control the repeat direction dramatically expands the range of effects possible in document design. For example, let's say you want a triple border on the left side of each H1 element in your document. You could then declare the following:

H1 {background-image: url(triplebor.gif); background-repeat: repeat-y;}

As we can see in Figure 6-34, the very small image

Figure 6-39

Figure 6-39. Centering the background image using percentages

In order to understand this concept, let's examine this processin closer detail. When you center a background image in an element,the point in the image which can be described as50% 50% is lined up with thepoint in the element that can be described the same way. This isshown in Figure 6-40.

Figure 6-40

Figure 6-40. Lining up the center of the image with the center of the browser window

Thus, if you want to place a single background image a third of the margins. (If the DIV had any padding, there would be even more blank space, but that wasn't the case here.)

In a similar fashion, the overall width of a list item's element box is equal to the content width of the list element that contains it. As you can see in Figure 8-8, the margins of a parent element can influence the layout of a child element.

Figure 8-8

Figure 8-8. List items' overall width equals the width of the UL element