级联菜单1
来源:互联网 发布:js Number(undefined) 编辑:程序博客网 时间:2024/06/05 04:50
<%@ page contentType=text/html; charset=GB2312 language=java errorPage=../error.jsp %>
<%@ include file=../conn.jsp%>
<%@ include file=../ds.jsp%>
<%@ taglib uri=http://java.sun.com/jsp/jstl/sql divfix=sql %>
<%request.setCharacterEncoding(gb2312); %>
<HTML> <HEAD>
<META http-equiv=Content-Type content=text/html; charset=gb2312>
<TITLE>级联菜单 </TITLE>
<LINK rel=stylesheet type=text/css href="http://java.ccidnet.com/art/3539/20080623/style.css>"
</HEAD>
<!--从数据库中得到二级栏目信息-->
<%String sql=select * from Nclass order by NclassId asc;
ResultSet rs=stmt.executeQuery(sql);
%>
<!--将二级栏目信息保存到数组subcat中-->
<script type=text/javascript>
var onecount;
onecount=0;
subcat = new Array();
<%
int count = 0;
while(rs.next()){
%>
subcat[ <%=count%>] = new Array( <%=rs.getString(NclassName)%>,
<%=rs.getString(NclassId)%>, <%=rs.getString(parentId)%>);
<%
count++;
}
rs.close();
%>
onecount= <%=count%>;
<!--决定select显示的函数-->
function changelocation(locationid)
{
document.myform.NclassId.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][2] == locationid)
{
document.myform.NclassId.options[document.myform.NclassId.length] = new
Option(subcat[i][0], subcat[i][1]);
}
}
}
</script>
<FORM method=POST name=myform action=adminsave.jsp?action=add>
<TABLE>
<TR>
<TD>一级分类 </TD>
<TD>
<SELECT name=classId onChange=changelocation(document.myform.classId.options
[document.myform.classId.selectedIndex].value) size=1>
<OPTION selected value>==请选一级分类== </OPTION>
<sql:query var=query dataSource=$>
SELECT * FROM class
</sql:query>
<c:forEach var=row items=$>
<option value=$>$ </option>
</c:forEach>
</select>
</TD>
<TD>选择二级分类 </TD>
<TD>
<SELECT name=NclassId>
<OPTION selected value>==请选二级分类== </OPTION>
</SELECT>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
<%@ page contentType=text/html; charset=GB2312 language=java errorPage=../error.jsp %>
<%@ include file=../conn.jsp%>
<%@ include file=../ds.jsp%>
<%@ taglib uri=http://java.sun.com/jsp/jstl/sql divfix=sql %>
<%request.setCharacterEncoding(gb2312); %>
<HTML> <HEAD>
<META http-equiv=Content-Type content=text/html; charset=gb2312>
<TITLE>级联菜单 </TITLE>
<LINK rel=stylesheet type=text/css href="http://java.ccidnet.com/art/3539/20080623/style.css>"
</HEAD>
<!--从数据库中得到二级栏目信息-->
<%String sql=select * from Nclass order by NclassId asc;
ResultSet rs=stmt.executeQuery(sql);
%>
<!--将二级栏目信息保存到数组subcat中-->
<script type=text/javascript>
var onecount;
onecount=0;
subcat = new Array();
<%
int count = 0;
while(rs.next()){
%>
subcat[ <%=count%>] = new Array( <%=rs.getString(NclassName)%>,
<%=rs.getString(NclassId)%>, <%=rs.getString(parentId)%>);
<%
count++;
}
rs.close();
%>
onecount= <%=count%>;
<!--决定select显示的函数-->
function changelocation(locationid)
{
document.myform.NclassId.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][2] == locationid)
{
document.myform.NclassId.options[document.myform.NclassId.length] = new
Option(subcat[i][0], subcat[i][1]);
}
}
}
</script>
<FORM method=POST name=myform action=adminsave.jsp?action=add>
<TABLE>
<TR>
<TD>一级分类 </TD>
<TD>
<SELECT name=classId onChange=changelocation(document.myform.classId.options
[document.myform.classId.selectedIndex].value) size=1>
<OPTION selected value>==请选一级分类== </OPTION>
<sql:query var=query dataSource=$>
SELECT * FROM class
</sql:query>
<c:forEach var=row items=$>
<option value=$>$ </option>
</c:forEach>
</select>
</TD>
<TD>选择二级分类 </TD>
<TD>
<SELECT name=NclassId>
<OPTION selected value>==请选二级分类== </OPTION>
</SELECT>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
- 下拉菜单级联(1)
- 级联菜单1
- 级联菜单1
- 级联菜单
- 级联菜单
- 级联菜单
- 级联菜单
- 级联菜单
- 菜单级联
- 菜单级联
- 级联菜单
- 级联菜单
- 级联菜单
- 级联菜单
- 级联菜单
- 级联菜单
- 级联菜单,省市级联菜单
- 级联菜单,两级菜单
- ASP.NET控件开发初探(一)
- 在UltraEdit中实现实体化字符
- Mnesia 学习笔记(3)
- J2ME GIF 编码器(支持动画)
- 321
- 级联菜单1
- ww
- SQL SERVER 中的数据类型
- squid体系结构(父亲,姐妹,多播)
- 魔兽的一些英语基础
- tomcat6 ssl+yale csa 简单配置
- 唉,又过年了
- 41家大公司年度福利比较 大公司福利档案揭秘收藏
- 2第四章 信心——潜能的高效催化剂