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

Tuesday 20th of February 2018 02:49:21 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
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! of blank space around it, or that a heading should be a certain size.By understanding the concepts put forth here, you'll be able tolearn and use the rest of CSS much more quickly.

However, that's the good news. The bad news is that thischapter will contain a good many caveats, warnings, and discussionsof browser bugs and inconsistencies between operating systems.Remember, though, that CSS is not supposed to be a totally preciselayout language -- and besides, many of the issues discussed inthe chapter are not the fault of CSS but are more fundamental issues element, the inline box will be the same as the contentarea.

8.4.4. Inline Replaced Elements

Inlinereplaced elements, such as images,are subject to a few crucial differences in how inline formatting ishandled. This difference stems from the fact that replaced elementsmust equal 400 pixels, and no padding or borders are set, and the right margin and width are set to 100px while the left margin is set to auto, then the left margin will be 200 pixels wide:

P {margin-left: auto; margin-right: 100px; width: 100px;} 

The results are shown in Figure 8-11.

Figure 8-11

Figure 8-11. Automatic left margin

In a sense, auto can be used to say, "make up the difference between everything else and the requiredwill hold up in more than one media; for example, documents that will look good on a monitor as well as a printout.

It's also possible to mix percentages with length values. Thus, to set H1 elements to have top and bottom margins of one-half em and side margins that are 10% of the width of the browser window, you can declare the following, shown in Figure 7-12:

Figure 7-12. Mixed margins

Here, although the top and bottom margins will stay constant in any