关于级联菜单,onchange 没反应,请教了
表 QJID qy jz
1 1 孟河局
2 1 小河局
3 2 魏村局
4 2 安家局
代码:
<!--#include file="inc/conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Style.css" rel="stylesheet" type="text/css">
<script language ="javascript" >
var onecount;
onecount=0;
jzs = new Array();
<%
sql = "select * from qj "
set rs = conn.execute(sql)
i = 0
while not rs.eof
%>
jzs[<%=i%>] =new Array("<%=rs("qy")%>","<%=rs("jz")%>");
<%
i = i + 1
rs.movenext
wend
rs.close
set rs = nothing
%>
onecount=<%=i%>;
function changelocation(selvalue){
var selvalue = selvalue;
var i;
document.form2.jz1.length = 0 ;
document.form2.jz1.options[document.form2.jz1.length] = new option("请选择","");
for (i = 0 ;i < onecount;i++){
if(jzs[i][0]==selvalue){
document.form2.jz1.options[document.form2.jz1.length] = new option(jzs[i][1],jzs[i][1]);
}
}
}
</script>
<title></title>
</head>
<body>
<table width="391" border="0">
<tr valign="top">
<th width="385" height="53" ><div align="right">
<form name="form2" method="post" action="glsb.asp">
<div align="right">
<p><span class="tdbg"><strong>选择区域:</strong></span>
<select name="qy1" id="qy1" onchange="changelocation(document.form2.qy1.options[document.form2.qy1.selectedIndex].value)">
<option value=0 selected >请选择</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
选择局站:
<select name="jz1" id="jz1"> </select>
<input type="submit" name="Submit3" value="查询">
</p>
</div>
</form>
</div></th>
</tr>
</table>
<div align="center"></div>
</body>
</html>
第一级菜单,我选择后,第二级菜单没反应啊,谁能帮我看看,哪里出错了?