Forums

This topic is locked

Dynamic Dependent Parent/Child List Box - JavaScri

Posted 08 Aug 2002 16:09:55
1
has voted
08 Aug 2002 16:09:55 Sharon Burkey posted:
Hi

I've got a form with several dynamic dependent list boxes which is using the following java script:

function populateDynaList(oList, nIndex, aArray){
oList[oList.length]= new Option("<-- Please select an option -->";
for (var i = 0; i < aArray.length; i= i + 3){
if (aArray[i] == nIndex){
oList.options[oList.options.length] = new Option(aArray[i + 1], aArray[i + 2]);
}
}
if (oList.options.length == 0){
oList.options[oList.options.length] = new Option("[none available]",0);
}

oList.selectedIndex = 0;
}

My problem is that the 'none available' isnt working - which is causing me problems with the backend database. I presume I've missed something out of the function but for the life of me I can't figure it out!

Using: UD4, IIS, ASP, VScript mainly

Reply to this topic