ASP二级分类联动菜单
2008-07-23 17:18
387 查看
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<%
A = request.Form("anclassid")
B = request.Form("Nclassid")
if request.Form("Submit")="提交" then
response.Write "a="&A
response.Write "<br>b="&B
response.End()
end if
dim count
set rs=server.createobject("adodb.recordset")
'--------取出小类里的数据,Nclassidorder:小类在大类里的ID号
rs.open "select * from class order by id ",conn,1,1%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
<!---读出数据存入数组,第一位:class_name是小类名称,第二位:v_school是小类在大类里的ID号,三位:小类ID----->
subcat[<%=count%>] = new Array("<%= trim(rs("class_name"))%>","<%= rs("v_school")%>","<%= rs("id")%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.Nclassid.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{ //这句不是很理解
document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<body>
<table cellpadding="3" cellspacing="1" border="0" width="100%" class="tableBorder" align=center>
<tr height=25>
<th class="tableHeaderText" colspan=6 height=25>添加新商品</th>
</tr>
<tr>
<td class="forumRowHighlight" >
<table align=center>
<form name="myform" method="post" action="test.asp" OnSubmit="return checkkk()" >
<tr>
<td width="8%"> </td>
<td colspan="2">
<p>
<%
rs.open "select * from school order by school_id",conn,1,1
'-----------列出大类数据
if rs.eof and rs.bof then
response.write "请先添加栏目。"
response.end
else
%>
大类:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<%
A = request.Form("anclassid")
B = request.Form("Nclassid")
if request.Form("Submit")="提交" then
response.Write "a="&A
response.Write "<br>b="&B
response.End()
end if
dim count
set rs=server.createobject("adodb.recordset")
'--------取出小类里的数据,Nclassidorder:小类在大类里的ID号
rs.open "select * from class order by id ",conn,1,1%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
<!---读出数据存入数组,第一位:class_name是小类名称,第二位:v_school是小类在大类里的ID号,三位:小类ID----->
subcat[<%=count%>] = new Array("<%= trim(rs("class_name"))%>","<%= rs("v_school")%>","<%= rs("id")%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.Nclassid.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{ //这句不是很理解
document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<body>
<table cellpadding="3" cellspacing="1" border="0" width="100%" class="tableBorder" align=center>
<tr height=25>
<th class="tableHeaderText" colspan=6 height=25>添加新商品</th>
</tr>
<tr>
<td class="forumRowHighlight" >
<table align=center>
<form name="myform" method="post" action="test.asp" OnSubmit="return checkkk()" >
<tr>
<td width="8%"> </td>
<td colspan="2">
<p>
<%
rs.open "select * from school order by school_id",conn,1,1
'-----------列出大类数据
if rs.eof and rs.bof then
response.write "请先添加栏目。"
response.end
else
%>
大类:
相关文章推荐
- 一个强健 实用的asp+ajax二级联动菜单(有演示和附源程序打包下载)
- ASP.NET利用JavaScript实现无刷新闪烁二级联动菜单
- ASP—二级联动菜单的制作方法
- AJAX二级联动菜单教程(using asp and prototype)
- 基于asp+ajax和数据库驱动的二级联动菜单
- 我的ASP之旅—二级联动菜单制作
- ASP—二级联动菜单的制作方法
- ASP二级联动菜单制作
- ASP.NET利用JavaScript实现无刷新闪烁二级联动菜单
- asp联动二级菜单
- ASP,AJAX二级联动菜单
- ASP.NET利用JavaScript实现无刷新闪烁二级联动菜单
- ASP,AJAX二级联动菜单
- 一个asp+ACCESS省市二级联动菜单程序
- Asp.net 用datalist嵌套的方法实现二级菜单的分类导航
- ASP.NET利用JavaScript实现无刷新闪烁二级联动菜单
- ASP,AJAX二级联动菜单
- ASP.NET二级联动菜单的实现
- ASP,AJAX二级联动菜单