<%@ page import="java
contentType="text/html;charset=GB
%>
<style>
border
border
border
padding:
margin:
</style>
<SCRIPT LANGUAGE="JavaScript">
<!
function rv()
{
var val="";
for(i=
val+="
}
if(val
val=val
}
opener
self
}
//
</SCRIPT>
<body leftmargin="
<jsp:useBean id="user" scope="session" class="yava
<%
CDataSource ds=new CDataSource(); //數據聯結Bean實例
java
java
java
CDataCheck dc=new CDataCheck();
%>
<%
String sqlu="SELECT t
stmt=conn
rs=stmt
%>
<script language=
arr = new Array();
<% int temp=
while(rs
{
%>
arr[<%=temp%>]=new Array("<%=rs
<%
temp = temp +
}
%>
temp=<%=temp%>;
function ChangeLocation(id){
document
var i =
document
for(i=
if(arr[i][
document
}
}
}
</script>
<form name="combo_box">
<table border="
<tr height="
<td bgcolor="#
<td bgcolor="#
<td bgcolor="#
<td bgcolor="#
</tr>
<tr>
<td>
<select multiple id=prov name="prov" onchange="ChangeLocation(combo_box
<option value="
<%
String sqld="SELECT * FROM tdept";
stmt=conn
rs=stmt
while(rs
{
%>
<option name="<%=rs
<%
}
%>
</select>
</td>
<td>
<select multiple id=city style="width:
</select>
</td>
<td nowrap align="center" class="bgc">
<input type="button" onClick="move(this
<input type="button" onClick="move(this
</td>
<td>
<select multiple size="
</select>
</td>
</tr>
<tr class="bgc">
<td colspan="
</tr>
</table>
</form>
<script language="JavaScript">
//人名移動
function move(fbox
var arrFbox = new Array();
var arrTbox = new Array();
var arrLookup = new Array();
var i;
for (i =
arrLookup[tbox
arrTbox[i] = tbox
}
var fLength =
var tLength = arrTbox
for(i =
arrLookup[fbox
if (fbox
arrTbox[tLength] = fbox
tLength++;
}
else {
arrFbox[fLength] = fbox
fLength++;
}
}
arrFbox
arrTbox
fbox
tbox
var c;
for(c =
var no = new Option();
no
no
fbox[c] = no;
}
for(c =
var no = new Option();
no
no
tbox[c] = no;
}
}
</script>
</body>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20554.html