Copy codeThe Code is as follows: <% @ page import = "java. util. Date, yava. fileapp. *, java. SQL .*;"
ContentType = "text/html; charset = GB2312" pageEncoding = "GB2312"
%>
<Style>
. F9 {font-size: 9pt ;}
. Bgc {background-color: # AECAF9; color: # 0033FF}
. Buttons {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">
<! --
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 (preferred for SUN Enterprise Applications): useBean id = "user" scope = "session" class = "yava. fileapp. UserBean"/>
<%
CDataSource ds = new CDataSource (); // data connection Bean instance
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 ();
Rs1_stmt.exe cuteQuery (sqlu );
%>
<Script language = Javascript>
Arr = new Array ();
<% Int temp = 0;
While (rs. next ())
{
%>
Arr [<% = temp %>] = new Array ("<% = rs. getString ("fname") %> "," <% = rs. getString ("fdept") %> ");
<%
Temp = temp + 1;
}
%>
Temp = <% = temp %>;
Function ChangeLocation (id ){
Document. combo_box.city.length = 0; // initialize the length of the 2nd-level menu. The subscript starts from 0.
Var I = 0;
Document. combo_box.city.options [0] = new Option (-------,);
For (I = 0; I <temp; I ++ ){
If (arr [I] [1] = id) {// if they are equal, it is proved that there is a subset of the 2nd-level organization input in level 1st, and arr [total number] [Department]
Document. combo_box.city.options [document. combo_box.city.length] = new Option (arr [I] [0], arr [I] [0]);
}
}
}
</Script>
<Form name = "combo_box">
<Table border = "0" cellspacing = "0" cellpadding = "0" height = "210" width = "59">
<Tr height = "24">
<Td bgcolor = "#336699" class = "buttons" align = center> <font color = # ffffff> select a department </font> </td>
<Td bgcolor = "#336699" class = "buttons" align = center> <font color = # ffffff> name selection </font> </td>