Calendar
Calendar assists the user in entering dates by providing a popup calendar. The calendar is an implementation of Matt Kruse's code and supports all of the CF5 and CFMX locales. To create a calendar in another language, you must set the locale (using SetLocale()) of the page before the opening cf_terraform tag. Calendar requires the ResourcePath attribute to be set correctly in your opening cf_terraform tag or your defaults.cfm settings file.
The following special attributes are available for Calendar:
-
DisabledDates (new in 2.5)
Optional. Specify a list of dates or date ranges to exclude from selection. Place a colon between the two extrema of a range. For example: "2003-12-21:2004-1-15,2004-2-1" excludes the dates from December 21 2003 to January 15 2004, as well as the date February 1 2004. Note that manually entered dates within these ranges will not fail validation. For a simple range (e.g. a single minimum date and perhaps an end date), use thecf_terrafieldattributesminandmax. This will provide the same effect, and data validation will occur. -
DisabledWeekdays
Optional. Specify a list of days of the week to disable, where each day is referenced as a number from 0 (Sunday) to 6 (Saturday). Note that manually entered disabled days will not fail validation. -
ButtonCaption
Optional. The text to appear on the calendar button. -
buttonPassthrough
Optional. Attributes to pass through to thebuttontag to the right of the text input field. Remember to escape any double quotes (") or hashes / pound signs (#) by doubling them. See the second example below. -
offsetX
Optional (defaults to -152). X offset of the popup calendar based on the top left corner of the button. This attribute in comination withoffsetYcan be handy when trying to resolveselectshow-through issues. -
offsetY
Optional (defaults to 25). Y offset of the popup calendar based on the top left corner of the button. -
PopupWindow
Optional. If yes, open a popup window for the calendar, otherwise display as a DIV layer on the page. select boxes are notoriously poor at supporting dHTML, and shine through DIVs. If you have this problem on your form, you can either move the select box, or set the calendar to display in a popup window. -
ShowYearNavigation
Optional. If yes, Display arrows to allow you to click through entire years at a time.
Other non-TerraField attributes will be passed through to the underlying text tag (<input type="text">). For example:
style="border : 1px solid red"readonlyonMouseOver="focus()"class="sidebar"title="My Title"
Examples
Fields marked with * are required.
