Popup Calendar 1.0 - DHTML Lab | 8 | WebReference

Popup Calendar 1.0 - DHTML Lab | 8


Pop-up Calendar 1.0
Calendar Customization

Calendars can be customized in two ways:

Change the property values of the default JavaScript calendar object. These properties are found in the first lines of the dlcalendar.js script:

var dlcalendar_oCalendarDefaults =
    idbase      : "dl_calendar_",
    months      : "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
    days        : "Su,Mo,Tu,We,Th,Fr,Sa",
    firstday    : "Mo",
    date_format : "MMM-dd-yyyy",
    start_date  : "",
    end_date    : "",
    root_date    : "",
    input_element_id : "",
    click_element_id : "",
    tool_tip    : "Click for calendar",
    navbar_style : "",
    daybar_style : "",
    selectedday_style : "",
    weekendday_style  : "",
    regularday_style  : "",
    othermonthday_style : "",
    use_webdings : false,
    nav_images : "dlcalendar_prevyear_white.gif,...,dlcalendar_nextyear_white.gif",
    hide_selects : true,
    hide_onselection : true,
    callfunction_onselection : null

Take care when editing these properties as errors will affect all calendars.

Per Calendar
Specify attribute values in the <dlcalendar> tag, as in the examples illustrated earlier. This is the suggested customization method.

All the possible attributes are outlined in the following pages. Some attributes can be set globally, some by calendar and some both ways. Only a few are required, and one is required conditinoally.

All the attributes are marked with this legend:

The attribute can be set globally, as an object property, in the dlcalendar.js external script, and will affect all pages that load the external script.
The attribute can be set by calendar, as an attribute of the <dlcalendar> tag, and will affect only the calendar defined by the particular tag.
The attribute must have a value.
If the attribute can be set globally, a default value is already provided.
If it can be set only on a calendar basis, then you must provide it. There is only one such attribute, click_element_id
The attribute requires a value if a another attribute is set. There is only one such attribute, date_format.
The attribute does not need a value. The calendar will function perfectly without it. For some of these attributes, default values have been set and will kick in. Other apply to behavior customization and are completely optional.

Now, let's look at the attributes in detail.

Send a comment or suggestion to Peter Belesis

Created: July 20, 2004
Revised: July 20, 2004

URL: http://webreference.com/dhtml/column67/4.html