同一个页面里能用两个联动菜单吗?
<script language=JavaScript>
<%
dim sql,i,j
set rs=server.createobject("adodb.recordset")
sql="select * from ck_rootclass order by id desc"
rs.open sql,conn,1,1
tmpid=rs("id")
%>
var selects=[];
selects['#']=new Array(new Option('请选择分类','#'));
<%
for i=1 to rs.recordcount
%>
selects['<%=rs("id")%>']=new Array(
<%
set rsk=server.createobject("adodb.recordset")
sql="select * from ck_bigclass where rootclass="&rs("id")&" order by id"
rsk.open sql,conn,1,1
if rsk.recordcount>0 then
for j=1 to rsk.recordcount
if j=rsk.recordcount then
%>
new Option('<%=trim(rsk("ck_bigclass"))%>','<%=rsk("id")%>'));
<%else%>
new Option('<%=trim(rsk("ck_bigclass"))%>','<%=rsk("id")%>'),
<%
end if
rsk.movenext
next
else
%>
new Option('暂无类型','0'));
<%
end if
rsk.close
set rsk=nothing
rs.movenext
next
rs.close
set rs=nothing%>
//new Option('','0'));
<!--//////////JavaScript控制联动///////////-->
function chsel(classn,bigclass){
with (document.s2){
if(classn.value) {
bigclass.options.length=0;
for(var i=0;i<selects[classn.value].length;i++){
bigclass.add(selects[classn.value][i]);
}
}
}
}
</script>
=================================
<form action="ck.asp?action=set2" method="post" name="s2">
<tr bgcolor="#FFF4F4">
<td height="251" align="center" bgcolor="#FFF4F4">
<table width="46%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#FFD7D7">
<td width="20%"><div align="center">ID</div></td>
<td width="39%"> <div align="center">分类</div></td>
<td width="41%"> <div align="center">类型</div></td>
</tr>
<%for i=1 to request.form("num")%>
<tr bgcolor="#FFF4F4">
<td><div align="center"><%=i%></div></td>
<td><select name="classn<%=i%>" id="select" onChange=chsel(classn<%=i%>,bigclass<%=i%>)>
<option value="#" selected>请选择分类</option>
<%
'dim tmpid '定义一个临时变量用来记住省id
'tmpid=0
sql="select * from ck_rootclass order by id desc"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<optione value=#>暂无任何分类</option>"
else
'response.write "<optione value=#>请选择分类</option>"
while (not rs.eof)
'tmpid=rs("id")
%>
<option value="<%=rs("id")%>"><%=rs("ck_class")%></option>
<%
rs.movenext
wend
end if
rs.close
set rs=nothing
%>
</select></td>
<td><font color="#FF0000">
<select name="bigclass<%=i%>" id="select2">
<%response.write "<option value=#>选择类型</option>"%>
</select>
</font></td>
</tr>
<%next%>
<tr bgcolor="#FFF4F4">
<td colspan="3"> <div align="right">
<input type="submit" name="Submit2" value="·确定·">
</div></td>
</tr>
</table>
<font color="#FF0000"> </font> </td>
</tr>
</form>
</table>
为什么出来的效果里不能选择同一个分类下的二级分类?空白的~头晕ING~