------------- datebox WebObject ------------------------------- * - The webobject datebox can be used to select the date from a calendar. It can be used like this: First include the webclass that defines it: (DATEBOX_PATH is defined by the framework) Then declare as many datebox objects as needed: etc. The attribute 'value' is used to initialize the datebox with an initial value. If it is not given, then the default is {{{{obj_name}}}} (in the last example above it would be {{contact_date}}). The attribute 'format' is used to specify the format of the date. The reckognized formats are: YYYY-MM-DD (default) MM/DD/YYYY MM-DD-YYYY DD/MM/YYYY DD-MM-YYYY Actually this is only the format of the display, because the internal format is allways YYYY-MM-DD, the format used by the databases. E.g. if the above datebox webobject is declared inside a form with the name 'editDoc', then "document.editDoc.information_date.value" returns the date in the internal format (in the format YYYY-MM-DD). The attribute 'onchange' (be carefull, all lowercase) is used to call any validation function at the time that the date is changed. If you pass 'this' as a argument to this function, then it refers to the display format. E.g. if 'date' is the parameter to which 'this' is passed, then "d = date.value;" gets the selected date in the display format (which is specified by the attribute 'format'), and "date.value = d;" sets the date of the datebox ('d' should be in the format specified by 'format'). If you want to modify this webobject, you can copy it to a path local to the application, modify it and use the modified copy, e.g. Bugs: When you change the date, the validation code of the "onchange" is executed and it changes the date like this: "date.value = d;" the internal value is not updated, so the value saved in the DB is the selected one (which is wrong).