为什么我下面的 “三级联动” 是错的?(郁闷中...)
<%
'OK工作室 http://ok123.k989.com
'sort 一级分类表:sort_id,sort_name
'nsort 二级分类表:nsort_id,sort_id,nsort_name
'nnsort 三级分类表:nnsort_id,nsort_id,nnsort_name
%>
<%dim countL,countL2,rsA,rsA2,conn,connstr
'创建连接
set conn=server.createobject( "adodb.connection ")
connstr= "Provider=SQLNCLI;Server=wu\sqlexpress;Database=test_yc;Uid=sa;pwd=1234; "
conn.open connstr
%>
<%
dim count
set rs=server.createobject( "adodb.recordset ")
sql= "select * from nsort "
rs.open sql,conn,1,3
%>
<script language = "JavaScript ">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[ <%=count%> ] = new Array( " <%= trim(rs( "nsort_name "))%> ", " <%= trim(rs( "sort_id "))%> ", " <%= trim(rs( "nsort_id "))%> ");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount= <%=count%> ;
function changelocation(locationid)
{
document.form.nsort_id.length = 0;
var locationid=locationid;
document.form.nsort_id.options[0] = new Option( '二级分类 ', ' ');
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form.nsort_id.options[document.form.nsort_id.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<%
sql = "select * from nnsort "
rs.open sql,conn,1,1
%>
<script language = &quo