Ok, i haven't done JavaScript in ages, as i've moved onto php. However, a client wants me to do some javascript which is supposed to do the following:

when a user clicks a radio button, javascipt populates the next drop-down depending on which radio button they clicked. This then happens to a next drop-down list.

Now, i'm still toying with different ideas, but this is my best effort:

function change1(){
var radio = 3; // amount of radio buttons
var i=0;
while(i < radio)
	       b = i + 1;
var x;
var leveltwo = new Array()
leveltwo[0] = "option 1"
leveltwo[1] = "option 2"
leveltwo[2] = "option 3"
function secondlevel(b){
document.getElementById('second').innerHTML = "<select name=\"leveltwo\">";
for (x in leveltwo){
document.getElementById('second').innerHTML += "<option name=\"leveltwo\" value=\"" + leveltwo[x] + "\">" + leveltwo[x] + "</option>";
document.getElementById('second').innerHTML += "</select>";

<table align="center"><tr>
<td>Select a vehicle:&nbsp;</td>
a: <input type="radio" name="make" value="A" onChange="change1()">
b: <input type="radio" name="make" value="B" onChange="change1()">
c: <input type="radio" name="make" value="C" onChange="change1()">
<td align=center id="second" height="150px" width="220px">

But, if i run that and click a radio button, the box "second" has an empty selectbox and next to it says "option 1option 2option 3". I see that the select box is supposed to be populated with the option 1, option 2 and option 3, but it simply doesn't.

I did look on dynamicdrive, but their scripts aren't really select-radio convertable if you catch my drift.

Please can someone look at my code and see what's wrong. I just can't get it!