Package WebGUI::Macro::YUIDateChooser
DESCRIPTION
Macro for displaying a YUI (http://developer.yahoo.com/yui/) popup calendar attached to an input tag as specified by input_field_name.
process ( [libs], input_field_name, [calendar title], ["options"] )
libs string
Includes the required popup calendar and style libs.
An optional string containing the pattern "libs" which should be used only once in the page layout Metadata
"Extra <head> elements (tags)" field. Ex: ^YUIDateChooser(libs);
when specifying libs as the first parameter you can also specify a javascript validation filename
relative to the extras directory as the source of the Date.IsValid function.
Ex: ^YUIDateChooser(libs, date.js);
input_field_name string
The input tag field name.
Ex: ^YUIDateChooser("",requested_date);
generated tag: <input type="text" id="requested_date" name="requested_date" style="position:static;"/>
"calendar title" string
The title of the calendar.
Ex: ^YUIDateChooser("",requested_date,"Service date:");
"options" string
Extra options that will control date validation..
Ex: ^YUIDateChooser("",requested_date,"","required:true,validation:true");
options:
required:[true‚false] default = false
if set to true the input tag must contain a value
validation:[true,false] default = false
if set to true the input tag must contain a valid date
TODO:
Setup:
The distributed zip file has the proper directory structure for WebGUI. Make sure you download and pass date.js as the second parameter to libs.
Troubleshooting: If you get javascript page errors such as:
Date.isValid is not a function
Make sure you have downloaded and included the date.js!