|
发表于 2012-11-28 03:47:58
|
显示全部楼层
jsp+javascript打造级连菜单
<%@ page import="java.util.Date,yava.fileapp.*,java.sql.*;"
contentType="text/html;charset=GB2312" pageEncoding="GB2312"
%>www.whkfp12.com,www.wxkfp12.com,www.zzkfp12.com,
<style>
.f9{ font-size:9pt; }
.bgc{ background-color:#AECAF9; color: #0033FF }
.butt**{font-family:Arial; font-size:13px; font-weight:bold; background-color:#6796E4; color:white; border-top: solid 2px #AACAFB;
border-bottom: solid 1px #4E7DC1;
border-left: solid 1px #AECAF9;
border-right: solid 1px #5679BD;
padding:1px;
margin:0px;}
</style>
<SCRipT LANGUAGE="Javascript">
<!-www.cckfp146.com,www.cskfp146.com,www.whkfp146.com,-
function rv()
{
var val="";
for(i=0;i<combo_box.list2.length;i++){
val+=","+combo_box.list2[i].value;
}
if(val.charAt(0)==","){
val=val.substr(1,val.length);
}
opener.form1.frecname.value=val;
self.close();
}
//-->
</SCRIPT>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<jsp:useBean id="user" scope="session" class="yava.fileapp.UserBean" />
<%
CDataSource ds=new CDataSource(); //数据联结Bean实例
java.sql.Connection conn=ds.getConnection();
java.sql.Statement stmt=null;
java.sql.ResultSet rs=null;
CDataCheck dc=new CDataCheck();
%>
<%
String sqlu="SELECT t1.fno, t1.fname, t2.fname AS fdept FROM tuser t1 LEFT OUTER JOIN TDept t2 ON t1.fdept = t2.fno order by t2.fname";
stmt=conn.createStatement();
rs=stmt.executeQuery(sqlu);
%>
<script language='Javascript'>
arr = new Array();
<% int temp=0;
while(rs.next())
{
%>
arr[<%=temp%>]=new Array("<%=rs.getString("fname")%>","<%=rs.getString("fdept")%>");
|
|