asp联动二级菜单
来源:互联网 发布:罗马全面战争知乎 编辑:程序博客网 时间:2024/04/20 07:53
<%@ Language=VBScript %>
<%Option Explicit%>
<html>
<head>
<title>List</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
dim conn
dim rs
dim sql
dim count
dim rs1
dim sql1
set conn = server.CreateObject ("adodb.connection")
conn.Open "test","sa",""
sql = "select * from district order by locationid asc"
set rs = conn.execute(sql)
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("districtname"))%>","<%= trim(rs("locationid"))%>","<%= trim(rs("districtid"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
set rs=nothing
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.smalllocation.length = 0;
var locationid=locationid;
var i;
document.myform.smalllocation.options[0] = new Option('====所有地区====','');
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.smalllocation.options[document.myform.smalllocation.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
</head>
<body>
<form name="myform" method="post">
<select name="biglocation" onChange="changelocation(document.myform.biglocation.options[document.myform.biglocation.selectedIndex].value)">
<%
sql1 = "select * from location order by locationname asc"
set rs1 = conn.Execute (sql1)
do while not rs1.eof
%>
<option value="<%=trim(rs1("locationid"))%>"><%=trim(rs1("locationname"))%></option>
<%
rs1.movenext
loop
rs1.close
set rs1 = nothing
conn.Close
set conn = nothing
%>
</select>
<select name="smalllocation">
<option selected value="">==所有地区==</option>
</select>
</form>
<script LANGUAGE="javascript">
changelocation(document.myform.biglocation.options[document.myform.biglocation.selectedIndex].value);
</script>
</body>
</html>
- asp联动二级菜单
- ASP二级联动下拉菜单
- ASP二级分类联动菜单
- ASP,AJAX二级联动菜单
- asp+javascript 二级联动菜单
- ASP二级联动菜单制作
- ASP—二级联动菜单的制作方法
- ASP—二级联动菜单的制作方法
- ASP+数据库版的二级联动菜单
- 二级联动菜单详解
- 二级联动菜单详解
- .net 二级联动菜单
- js二级联动菜单
- 二级联动菜单
- Ajax二级菜单联动
- 省市联动二级菜单
- ajax二级联动菜单
- 省市联动二级菜单
- SEH结构化异常处理
- 获取路径名的原始大小写状态
- 已知三角形三个边的长度值,求三个角的大小
- EXCELSHEET 中"输入”或“编辑”状态与“就绪”状态的切换
- 想事情和做事情
- asp联动二级菜单
- 常用链接
- 向 lua 虚拟机传递信息(转自 云风的 BLOG )
- ObjectBuilder
- windows XP常用进程表
- lua的使用(摘自luachina)
- SQL Server连接中的四个最常见错误:
- 首届“敏捷中国”开发者大会 精彩问答
- 80前的前辈,你们都做了些什么?!(八)