ASP动态级联菜单实现代码
发布时间:2016-12-29 来源:查字典编辑
摘要:请选择……请选择
<>
<%
setrs1=server.CreateObject("adodb.recordset")
sql1="select*fromtype1"
rs1.opensql1,conn,1,3
setrs2=server.CreateObject("adodb.recordset")
sql2="select*fromtype2"
rs2.opensql2,conn,1,3
%>
<formname="form1">
<>
<selectname="type"size="1"onChange="redirect(this.options.value)">
<optionvalue=0>请选择……</option>
<%whilenotrs1.eof%>
<optionvalue="<%=rs1("news_type_1_id")%>"><%=rs1("news_type_1_type")%></option>
<%rs1.movenext
wend%>
</select>
<>
<selectname="type2"size="1">
<optionvalue=0>请选择</option>
</select>
</div>
</form>
<>
<script>
<)
temp.options[m]=null
<%whilenotrs2.eof
%>
cnt=<%=rs2("news_type_1_id")%>
if(cnt==x){
temp.options=newOption("<%=rs2("news_type_2_type")%>","<%=rs2("news_type_2_id")%>")
i=i+1}
<%
rs2.movenext
wend%>
}
//-->
</script>