Hi
A working example is located at
http://rainforestnet.com/demo_datetimepicker.htm
I have attached the fileDateTimePicker_css.txt which holds the javascript code for the calender.
I call the function NewCssCal which sets the settings for the control
function NewCssCal(pCtrl,pFormat,pScroller,pShowTime,pTimeMode,pHideSeconds)
NewCssCal calls function RenderCssCal(bNewCal) to build the calender
NewCssCal also calls function Calendar(pDate,pCtrl) to create a calender object with a date.
RenderCssCal calls the function GenCell(pValue,pHighLight,pColor) to Generate each of the cells of the calender table cell with values.
I think RenderCssCal is where I need to call my javascript function but I cannot understand how it closes. I know it calls itself recursion to rebuild the calendar.
Inside RenderCssCal it fills a variable with function callback
var funcCalback="function callback(id, datum) {\n";
funcCalback+=" var CalId = document.getElementById(id); if (datum== 'undefined') { var d = new Date(); datum = d.getDate() + '/' +(d.getMonth()+1) + '/' + d.getFullYear(); } window.calDatum=datum;CalId.value=datum;\n";
funcCalback+=" if (Cal.ShowTime) {\n";
funcCalback+=" CalId.value+=' '+Cal.getShowHour()+':'+Cal.Minutes;\n";
funcCalback+=" if (Cal.ShowSeconds)\n CalId.value+=':'+Cal.Seconds;\n";
funcCalback+=" if (TimeMode==12)\n CalId.value+=''+Cal.getShowAMorPM();\n";
funcCalback+="}\n winCal.style.visibility='hidden';\n}\n";
This fills the attached textbox with the selected date from the calender and closes the calendar. I tried adding my function to the end of this variable but it only called my function once at the beginning.
Thanks
Mike