简单问题 select 表格隐藏
<script type="text/javascript">function cht(){
var tt=document.getElementById("TAction").value;
switch(tt){
case "0":
tb1.style.display="none";
tb2.style.display="none";
break;
case "1":
tb1.style.display="";
tb2.style.display="none";
break;
case "2":
tb1.style.display="";
tb2.style.display="";
break;
}
}
</script>
<table>
<tr><td><input name="name3" type=text id='name3'>
</td></tr>
<tr><td>
<select id='TAction' name="TAction" size="1" onchange="cht()">
<option value='0' <%if rs("TAction")=0 then response.write "selected"%>>0</option>
<option value='1' <%if rs("TAction")=1 then response.write "selected"%>>1</option>
<option value='2' <%if rs("TAction")=2 then response.write "selected"%>>2</option>
</select>
</td></tr>
<tr id="tb1" style="display:none;"><td> <input name="name1" type=text id='name1'> </td></tr>
<tr id="tb2" style="display:none;"><td><input name="name1" type=text id='name1'></td></tr>
</table>
打开页面转过来无论TAction的值是几,所有表格都是隐藏的
请问如何让这个页面打开直接显示相应的表格数,然后仍然可以根据相应的选择显示或隐藏表格。