///////////////////////////////////////////////////////////////////////////// function onSelectDate(datelistid, datelistvalueid) { updateHiddenValue(datelistid, datelistvalueid); } ///////////////////////////////////////////////////////////////////////////// function onSelectTime(timelistid, monthlistid, datelistid, datelistvalueid) { var timelist = document.getElementById(timelistid); var monthlist = document.getElementById(monthlistid); var datelist = document.getElementById(datelistid); monthlist.selectedIndex = 0; datelist.options.length = 0; datelist.options[0] = new Option('--select date--', ''); datelist.disabled = true; updateHiddenValue(datelistid, datelistvalueid); } //////////////////////////////////////////////////////////////////////////// function onSelectMonth(timelistid, monthlistid, datelistid, datelistvalueid) { var timelist = document.getElementById(timelistid); var monthlist = document.getElementById(monthlistid); var datelist = document.getElementById(datelistid); datelist.options.length = 0; datelist.options[0] = new Option('--select date--', ''); if (monthlist.selectedIndex == 0) { datelist.disabled = true; } else { var timelistvalue = timelist.options[timelist.selectedIndex].value.substring(0, 3); var dayindex = 0; if (timelistvalue == 'Sun') { dayindex = 0; } else if (timelistvalue == 'Mon') { dayindex = 1; } else if (timelistvalue == 'Tue') { dayindex = 2; } else if (timelistvalue == 'Wed') { dayindex = 3; } else if (timelistvalue == 'Thu') { dayindex = 4; } else if (timelistvalue == 'Fri') { dayindex = 5; } else if (timelistvalue == 'Sat') { dayindex = 6; } var monthindex = monthlist.options[monthlist.selectedIndex].value; var datearr = eval('dates' + dayindex.toString() + '_' + monthindex.toString()); datelist.disabled = false; var x = 0; for (x = 0; x != datearr.length; x++) { datelist.options[x + 1] = new Option(datearr[x], datearr[x]); } } updateHiddenValue(datelistid, datelistvalueid); } ///////////////////////////////////////////////////////////////////////////// function updateHiddenValue(datelistid, datelistvalueid) { var datelist = document.getElementById(datelistid); var datelistvalue = document.getElementById(datelistvalueid); datelistvalue.value = datelist.options[datelist.selectedIndex].text; if (datelistvalue.value == '--select date--') { datelistvalue.value = ''; } } /////////////////////////////////////////////////////////////////////////////