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

Saturday 21st of April 2018 07:28:26 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
(since the line-height is more than the font-size). This will result in an inline box 18 pixels tall, and its top is aligned with the top of the line box. Thus Figure 8-56.

Figure 8-56

Figure 8-56. Top-aligning text with a different line height

Before we go any further, let's see what happens when we add box properties to inline elements.

* 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! BODY, and from its top left corner.

Figure 6-51

Figure 6-51. The difference between starting a repeat from top left (left) and centering it (right)

Note the differences along the edges of the browser window. When thebackground repeats from the center, the grid is centered within theviewport, resulting in consistent "clipping" along theedges. The variations may seem subtle, but the odds are thatyou'll have reason to use both approaches at some point in yourdesign career.

no Italic face, but there is an Oblique face, then the latter can beused for the former. If the situation is reversed -- an Italicface exists, but there is no defined Oblique face -- the useragent may not substitute the former for the latter, according to theCSS specification. Finally, the user agent can simply generate theoblique face by computing a slanted version of the upright font. Infact, this is what most often happens in a digital world, whereit's fairly easy to slant a font using a simple computation.

Furthermore, you may find that in some operating systems, a giventhey are in focus. User agents are not required to reflow the document based on styles assigned to these pseudo-elements, although some may do so -- it remains to be seen. :lang

On a completely different note is this:

<P STYLE="font-size: 12px; line-height: 12px;">This is text, <EM>some of which is emphasized</EM>, plus other text<BR>which is <B STYLE="font-size: 24px;">boldfaced</B>and <SPAN STYLE="vertical-align: top; line-height: 4px;">tall</SPAN>and which is<BR>larger than the surrounding text.</P>

Since the line-height for the "tall" block's height and width. That's fine as far as itgoes -- but what happens if the containing block is only 50 pixelstall by 200 pixels wide? That gives you an element only 35 pixelswide by 80 pixels tall. That doesn't leave much room to showthe content, but if you use auto for the width orheight, the element might fill its entire containing block, obscuringthe containing block's contents.

As we'll see later in the chapter, you have the option to forceyour content to overflow the element. For now, however, let's