|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Hi all,
I have a date selector in my asp page as Year, Month and day. These 3 List/Menu gets populated with respect to each other, i.e., when a particular year in the first and a month in the second is selected, the dates for that year and month are populated into the third list box (named days). Everything is working fine but only the dates are been populated not the option values. I need the same date as the value in my "day" list box. I'm using the script given below, that fills all the dates for a particular month. I feel something has to be done in the line i've boxed below. Is that at the same line or anywhere else ? And what more should be added so as fill the same dates as values ? Please help.... function populate(objForm,selectIndex) { timeA = new Date(objForm.year.options[objForm.year.selectedIndex].text, objForm.month.options[objForm.month.selectedIndex].value,1); timeDifference = timeA - 86400000; timeB = new Date(timeDifference); var daysInMonth = timeB.getDate(); for (var i = 0; i < objForm.day.length; i++) { objForm.day.options[0] = null; } for (var i = 0; i < daysInMonth; i++) { |===========================================| |objForm.day.options[i] = new Option(i+1); | |===========================================| } document.f1.day.options[0].selected = false; } |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Listbox/Menu value problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|