Hello everyone! What a marvelous day!
I have a piece of script that pre-fills some drop down menus based on the selection of another drop down menu
<script type="text/javascript">
/*<![CDATA[*/
var FillArray=[];
FillArray[1]=[4,[B]2,2[/B]];
FillArray[2]=[4,[B]2,2[/B]];
FillArray[3]=[4,[B]2,2[/B]];
FillArray[4]=[4,[B]3,3[/B]];
FillArray[5]=[5,[B]5,5[/B]];
FillArray[6]=[5,[B]5,5[/B]];
FillArray[7]=[8,[B]8,8[/B]];
function Fill(){
var ary=FillArray[document.getElementById('pk1vehicle').value],selary=['pk1pax','pk1case','pk1carry'],sel,z0=0,z1a;
for (;z0<selary.length;z0++){
sel=document.getElementById(selary[z0]);
sel.options.length=0;
if (ary&&ary[z0]){
for (z1a=0;z1a<ary[z0];z1a++){
sel.options[z1a]=new Option(z1a+1,z1a+1);
}
sel.selectedIndex=0;
}
}
}
/*]]>*/
</script>
So basically if option 1 on the array is chosen:
FillArray[1]=[4,2,2];
3 drop downs are pre-filled with the values:
1,2,3,4
1,2
1,2
My problem is… for the 2nd and 3rd drop downs, I would like those to include 0 as an option…
Therefore I would want this…
FillArray[1]=[4,2,2];
to produce this:
1,2,3,4
0,1,2
0,1,2
I do not want the 0 to appear in the first drop down…
Can somebody please assist me?