I have one drop down menu, with cars, vans, motors. If you would select cars you see the next dropdown of van1,van2 and van3. If you select cars the next drop down will appear car1,car2, and car3. And if you would select motors you will see motor1,motor2 or motor3. the only resutl I get is one menu appears with this script. How can I make it for many menus????
Here is the function tht I have been trying with no results:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<script type="text/javascript">
function toggleVisibility(controlId)
{
var control = document.getElementById(controlId);
if(control.style.visibility == "visible" || control.style.visibility == "")
control.style.visibility = "hidden";
else
control.style.visibility = "visible";
}
</script>
<title>ShowHideControl</title>
</head>
<body>
<Select name="test" onchange="toggleVisibility('');">
<option value="1"> cars</option>
<option value="2"> vans</option>
<option value="3"> motors</option>
</Select>
<Select name="cars" id="cars">
<option value="1">car1 </option>
<option value="2">car2</option>
<option value="3">car3</option>
</Select>
</br>
<Select name="vans" id="vans">
<option value="1"> van1</option>
<option value="2"> van2</option>
<option value="3"> van33</option
</select>
<td>
<Select name="motors" id="motors">
<option value="1"> motor1</option>
<option value="2"> motor2</option>
<option value="3"> motor3</option>
</select>
</td>
</body>
</html>
Any help would be truly appreciated. Thank you in advance for your time.