请求高手帮忙,联动下拉框
<%@ Language=VBScript %><!--#include file="data.asp"--><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>设备登记</title>
<%
dim sql,rs
set rs=server.createobject("adodb.recordset")
sql="select * from [abss] where bz='1'"
rs.open sql,conn,1,1
%>
<script language="javascript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>]= new Array ("<%=trim(rs("id"))%>","<%=rs("sbbh")%>","<%=rs("xh")%>","<%=rs("sbmc")%>");
<%
count =count +1
rs.movenext
loop
rs.close
set rs=nothing
%>
onecount=<%=count%>;
function changelist(locationid)
{
document.form1.abss.length =0;
var i;
var locationid=locationid;
document.form1.abss.options[0] = new Option('====所有设备====','');
for (i=0;i<onecount;i++)
{
if(subcat[i][0]==locationid
{
document.form1.abss.options[document.form1.abss.length]= new option(subcat[i][3],subcat[i][1]);
}
}
}
</script>
<style type="text/css">
</style>
</head>
<body>
<p align="center"><b><font size="5" face="华文新魏" color="#1927ED">设备登记</font></b></p>
<hr height="4">
<form name="form1" method="post" width="600">
<p><font size="2"> 单位
<% Response.Write "<select name=id width=100px onChange=changelist(document.form1.id.options[document.form1.id.selectedIndex].value)>"
set rs=server.createobject("adodb.recordset")
sql="select * from [shop]"
rs.open sql,conn,1,1
do while not rs.eof
Response.Write "<option value="&rs("id")&">"&rs("name")&"</option>"
rs.movenext
loop
set rs=nothing
%> </select>
<font size="2">设备</font>
<select name="abss">
<option selected value="">==所有设备==</option></select>
</p>
<p align="center">
<input type="submit" name="Submit3" value="提交" style="background-color:#B8EFF6"></form>
<input type="submit" value="退出" style="background-color:#1CBFCC" ></p>
<%end if%>
</body>
</html>
请问怎么改才能联动abss选择项?请求高手帮我改一下