antonyx6666
Programmer
Hello all
I have some radio buttons that update some drop down menus on my form.
Each radio button has a different value (1-7). The problem I am having is that even when I select radio button 5, it is updating the drop down menus as value 1.
Not quite sure why this is happening. Any help would be greatly appreciated.
The HTML in full is below:
I have some radio buttons that update some drop down menus on my form.
Each radio button has a different value (1-7). The problem I am having is that even when I select radio button 5, it is updating the drop down menus as value 1.
Not quite sure why this is happening. Any help would be greatly appreciated.
The HTML in full is below:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>test page</title>
<SCRIPT type="text/javascript">
/*<![CDATA[*/
var FillArray=[];
FillArray[1]=[4,2,2];
FillArray[2]=[4,2,2];
FillArray[3]=[4,2,2];
FillArray[4]=[4,3,3];
FillArray[5]=[5,4,4];
FillArray[6]=[6,5,5];
FillArray[7]=[8,8,8];
function Fill(){
var ary=FillArray[document.getElementById('radiochoice').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>
</head>
<body>
<form id="bookingform" name="bookingform" action="##">
<!-- start -->
<p>
Value 1<input type="radio" name="radiochoice" id="radiochoice" value="1" onclick="Fill();">
Value 4<input type="radio" name="radiochoice" id="radiochoice" value="4" onclick="Fill();">
Value 5<input type="radio" name="radiochoice" id="radiochoice" value="5" onclick="Fill();">
Value 7<input type="radio" name="radiochoice" id="radiochoice" value="7" onclick="Fill();">
</p>
<p>
Value 2<input type="radio" name="radiochoice" id="radiochoice" value="2" onclick="Fill();">
Value 3<input type="radio" name="radiochoice" id="radiochoice" value="3" onclick="Fill();">
Value 6<input type="radio" name="radiochoice" id="radiochoice" value="6" onclick="Fill();">
</p>
<p>Drop 1: <select style="width:50px;" class="smallselect" name="pk1pax" id="pk1pax">
<option value="">...</option></select></p>
<p>Drop 2: <select style="width:50px;" class="smallselect" name="pk1case" id="pk1case">
<option value="">...</option></select></p>
<p>Drop 3: <select style="width:50px;" class="smallselect" name="pk1carry" id="pk1carry">
<option value="">...</option></select></p>
<!-- end -->
</form>
</body>
</html>