asp三级联动无法不能选择,下一级的,不知道怎么修改代码
<script language="JavaScript"> <!--
<%
Dim count2,rsClass2,sqlClass2
set rsClass2=server.createobject("adodb.recordset")
sqlClass2="select * from LY_bclass"
rsClass2.open sqlClass2,conn,1,1
%>
var subval2 = new Array();
<%
count2 = 0
do while not rsClass2.eof
%>
subval2[ <%=count2%>] = new Array(' <%=rsClass2("bclassid")%>',' <%=rsClass2("classid")%>',' <%=rsClass2("bclassen")%>')
<%
count2 = count2 + 1
rsClass2.movenext
loop
rsClass2.close
%>
<%
Dim count3,rsClass3,sqlClass3
set rsClass3=server.createobject("adodb.recordset")
sqlClass3="select * from LY_sclass"
rsClass3.open sqlClass3,conn,1,1
%>
var subval3 = new Array();
<%
count3 = 0
do while not rsClass3.eof
%>
subval3[ <%=count3%>] = new Array(' <%=rsClass3("nclassid")%>','<%=rsClass3("bclassid")%>',' <%=rsClass3("nclassen")%>')
<%
count3 = count3 + 1
rsClass3.movenext
loop
rsClass3.close
%>
function changepro(city,pro)
{
var city=city;
var pro=document.getElementById(pro).value;
var i;
document.getElementById(city).length=1;
for (i=0;i<subval2.length;i++){
if (subval2[i][1]==pro){
document.getElementById(city).options[document.getElementById(city).length]=new Option(subval2[i][0], subval2[i][0]);
}
}
}
//定义函数:用于联动市 和 县 两级-----county 为县级下拉框的id名,city为市下拉框的id 号。 用法:onChange="changecity('市id名','县id名');"///////////////////
function changecity(county,city)
{
var county=county;
var city=document.getElementById(city).value;
var j;
document.getElementById(county).length=1;
for (j=0;j <subval3.length;j++){
if (subval3[j][1]==city){
document.getElementById(county).options[document.getElementById(county).length]=new Option(subval3[j][0], subval3[j][0]);
}
}
}
//-->
</script>
<form name="form1" method="post" action="test1.asp">
<table width="100%" cellspacing="5">
<tr>
<td width="15%">Game: </td>
<td width="85%">
<%
Dim count1,rsClass1,sqlClass1
set rsClass1=server.createobject("adodb.recordset")
sqlClass1="select * from LY_class"
rsClass1.open sqlClass1,conn,1,1
%>
<select name="city1" id="city1" onChange="changepro('city2','city1');">
<option>-- Please select the game --</option>
<%
count1 = 0
do while not rsClass1.eof
response.write" <option value="&rsClass1("classid")&">"&rsClass1("classen")&" </option>"
count1 = count1 + 1
rsClass1.movenext
loop
rsClass1.close
%>
</select>
</td>
</tr>
<tr>
<td>Server: </td>
<td>
<select name="city2" id="city2" onChange="changecity('city3','city2');">
<option>-- Please select the server --</option>
</select>
</td>
</tr>
<tr>
<td>Product:</td>
<td>
<select name="city3" id="city3">
<option>-- Please select the product --</option>
</select>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</form>