asp 动态二级菜单
<tdwidth="20%"height="25"align="right">选择分类:</td><tdwidth="80%"height="25"><%setrsb=s...
<td width="20%" height="25" align="right">选择分类:</td>
<td width="80%" height="25">
<%
set rsb=server.createobject("adodb.recordset")
sqlb = "select * from BigClass order by sj desc"
rsb.open sqlb,conn,1,1
if rsb.eof and rsb.bof then
response.write "请先添加栏目。"
else
%><select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
<option selected value="<%=trim(rsb("id"))%>"><%=trim(rsb("BigClassName"))%></option>
<%
dim selclass
selclass=cstr(rsb("id"))
rsb.movenext
do while not rsb.eof
%>
<option value="<%=trim(rsb("id"))%>"><%=trim(rsb("BigClassName"))%></option>
<%
rsb.movenext
loop
end if
rsb.close
%>
</select>
<select name="SmallClassName">
<%
set rsss=server.createobject("adodb.recordset")
sqlss="select * from SmallClass where dl='"&selclass&"'"
rsss.open sqlss,conn,1,1
if not(rsss.eof and rsss.bof) then
%>
<option value="<%=rsss("id")%>"><%=rsss("SmallClassName")%></option>
<% rsss.movenext
do while not rsss.eof%>
<option value="<%=rsss("id")%>"><%=rsss("SmallClassName")%></option>
<%
rsss.movenext
loop
end if
rsss.close
%></select> </td>
一级分类正常..选了一级之后.二级的第一个选项始终不变.怎么把他去掉
就是图里这样.一级不管你选那个.二级的第一个都是婚介中心
这代码是修改那一短啊 展开
<td width="80%" height="25">
<%
set rsb=server.createobject("adodb.recordset")
sqlb = "select * from BigClass order by sj desc"
rsb.open sqlb,conn,1,1
if rsb.eof and rsb.bof then
response.write "请先添加栏目。"
else
%><select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
<option selected value="<%=trim(rsb("id"))%>"><%=trim(rsb("BigClassName"))%></option>
<%
dim selclass
selclass=cstr(rsb("id"))
rsb.movenext
do while not rsb.eof
%>
<option value="<%=trim(rsb("id"))%>"><%=trim(rsb("BigClassName"))%></option>
<%
rsb.movenext
loop
end if
rsb.close
%>
</select>
<select name="SmallClassName">
<%
set rsss=server.createobject("adodb.recordset")
sqlss="select * from SmallClass where dl='"&selclass&"'"
rsss.open sqlss,conn,1,1
if not(rsss.eof and rsss.bof) then
%>
<option value="<%=rsss("id")%>"><%=rsss("SmallClassName")%></option>
<% rsss.movenext
do while not rsss.eof%>
<option value="<%=rsss("id")%>"><%=rsss("SmallClassName")%></option>
<%
rsss.movenext
loop
end if
rsss.close
%></select> </td>
一级分类正常..选了一级之后.二级的第一个选项始终不变.怎么把他去掉
就是图里这样.一级不管你选那个.二级的第一个都是婚介中心
这代码是修改那一短啊 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询