This code will make the textboxes visible/invisible. If you want to Div's to be made visible/invisible, give the Div's an id and alter the code
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>dynamic dropdown populate multiple text box</title>
</head>
<body>
<script>
function Process()
{
var x = document.getElementById('option').selectedIndex;
var y = document.getElementById('option').value;
switch(x)
{
case 0:
break;
case 1:
document.getElementById('subtype4').style.visibility="hidden";
document.getElementById('subtype5').style.visibility="hidden";
break;
case 2:
document.getElementById('subtype4').style.visibility="visible";
document.getElementById('subtype5').style.visibility="visible";
break;
}
}
</script>
<form method="POST" action="###">
<table width="362" border="0" align="center">
<tr>
<td width="153" align="center" bgcolor="#31AFDA">
<font color="#FFFFFF">Option</font></td>
<td width="199"><div align="left">
<select name="option" id="option">
<option></option>
<option id="option1">option1</option>
<option id="option2">option2</option>
</select>
</div>
</td>
</tr>
<tr>
<td width="153" align="center" bgcolor="#31AFDA">
<font color="#FFFFFF">sub type1</font></td>
<td>
<div align="left">
<input id="subtype1" type="text" size="33" />
</div>
</td>
</tr>
<tr>
<td align="center" bgcolor="#31AFDA"><font color="#FFFFFF">sub
type2</font></td>
<td><div align="left">
<input id="subtype2" type="text" size="33" /></div></td>
</tr>
<tr>
<td width="153" align="center" bgcolor="#31AFDA">
<font color="#FFFFFF">sub type3</font></td>
<td>
<div align="left">
<input id="subtype3" type="text" size="33" />
</div>
</td>
</tr>
<tr>
<td width="153" align="center" bgcolor="#31AFDA">sub type4</td>
<td>
<input id="subtype4" type="text" size="33" /></td>
</tr>
<tr>
<td width="153" align="center" bgcolor="#31AFDA">sub type5</td>
<td>
<input id="subtype5" type="text" size="33" /></td>
</tr>
</table>
<p align="center"><input type="button" value="Submit" name="B1" önClick="Process()"></p>
</form>
</body>
</html>