Hi,
For my main index I need the following: Multiple dropdown boxes, which are also dynamic and will after the last selection automatically direct you to the requested page. So far I have this:
--
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var arrItems1 = new Array();
var arrItemsGrp1 = new Array();
arrItems1[3] = "English";
arrItemsGrp1[3] = 1;
arrItems1[4] = "Dutch";
arrItemsGrp1[4] = 1;
arrItems1[5] = "Help";
arrItemsGrp1[5] = 1;
arrItems1[6] = "English";
arrItemsGrp1[6] = 2;
arrItems1[7] = "Dutch";
arrItemsGrp1[7] = 2;
arrItems1[8] = "Help";
arrItemsGrp1[8] = 2;
arrItems1[0] = "DutchBird VA";
arrItemsGrp1[0] = 3;
function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
var myEle ;
var x ;
// Empty the second drop down box of any choices
for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
if (control.name == "firstChoice") {
}
// ADD Default Choice - in case there are no values
myEle = document.createElement("option") ;
myEle.value = 0 ;
myEle.text = "[SELECT]" ;
controlToPopulate.add(myEle) ;
// Now loop through the array of individual items
// Any containing the same child id are added to
// the second dropdown box
for ( x = 0 ; x < ItemArray.length ; x++ )
{
if ( GroupArray[x] == control.value )
{
myEle = document.createElement("option") ;
myEle.value = x ;
myEle.text = ItemArray[x] ;
controlToPopulate.add(myEle) ;
}
}
}
// End -->
</script>
</HEAD>
<BODY>
<form name=myChoices>
<table align="center">
<tr>
<td>
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this, myChoices.secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=1>IBERWORLD VA</option>
<option value=2>Regional</option>
<option value=3>Partners</option>
</SELECT>
</TD><TD>
<SELECT id=secondChoice name=secondChoice>
</select></TD>
</TR>
</TABLE>
</form>
--
Unfortunatly I don't know how I should make the rest I hope that someone is able to help me out with this..
With kind regards,
Bastiaan Klene.