白云岛资源网 Design By www.pvray.com
<!--打开两个表-->
<%
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from type1"
rs1.open sql1,conn,1,3
set rs2=server.CreateObject("adodb.recordset")
sql2="select * from type2"
rs2.open sql2,conn,1,3
%>
<form name="form1">
<!--建立菜单一-->
<select name="type" size="1" onChange="redirect(this.options.value)">
<option value=0>请选择……</option>
<%while not rs1.eof%>
<option value="<%=rs1("news_type_1_id")%>"><%=rs1("news_type_1_type")%></option>
<%rs1.movenext
wend%>
</select>
<!--建立菜单二-->
<select name="type2" size="1">
<option value=0>请选择</option>
</select>
</div>
</form>
<!--下面为具体实现的script语句-->
<script>
<!--
var temp=document.form1.type2
function redirect(x){
var i
i=0
for (var m=temp.options.length-1;m>0;m--)
temp.options[m]=null
<%while not rs2.eof
%>
cnt=<%=rs2("news_type_1_id")%>
if(cnt==x) {
temp.options=new Option("<%=rs2("news_type_2_type")%>","<%=rs2("news_type_2_id")%>")
i=i+1}
<%
rs2.movenext
wend%>
}
//-->
</script>
<%
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from type1"
rs1.open sql1,conn,1,3
set rs2=server.CreateObject("adodb.recordset")
sql2="select * from type2"
rs2.open sql2,conn,1,3
%>
<form name="form1">
<!--建立菜单一-->
<select name="type" size="1" onChange="redirect(this.options.value)">
<option value=0>请选择……</option>
<%while not rs1.eof%>
<option value="<%=rs1("news_type_1_id")%>"><%=rs1("news_type_1_type")%></option>
<%rs1.movenext
wend%>
</select>
<!--建立菜单二-->
<select name="type2" size="1">
<option value=0>请选择</option>
</select>
</div>
</form>
<!--下面为具体实现的script语句-->
<script>
<!--
var temp=document.form1.type2
function redirect(x){
var i
i=0
for (var m=temp.options.length-1;m>0;m--)
temp.options[m]=null
<%while not rs2.eof
%>
cnt=<%=rs2("news_type_1_id")%>
if(cnt==x) {
temp.options=new Option("<%=rs2("news_type_2_type")%>","<%=rs2("news_type_2_id")%>")
i=i+1}
<%
rs2.movenext
wend%>
}
//-->
</script>
白云岛资源网 Design By www.pvray.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
白云岛资源网 Design By www.pvray.com
暂无评论...