复制代码代码如下:
<%
薄暗いa
a = split(request.form( "sourcelist")、 ")
respons.write "source:"&request.form( "sourcelist")&ubound(a)& "<br> object:"&request.form( "objectlist")& "<br>"
%>
<html>
<head>
<meta http-equiv = "content-type" content = "text/html; charset = gb2312">
<title>無題のドキュメント</title>
<style type = text/css>
.bgsubleft {
背景ポジション:中央の底。背景イメージ:url(images/bgleft.gif);バックグラウンドリピート:Repeat-X
}
.bgsubleftn {
背景ポジション:左下;背景イメージ:url(images/bgleftn.gif);バックグラウンドリピート:繰り返し
}
</style>
<スクリプト言語= "javascript" type = "text/javascript">
関数addselectedList()
{
var objsource = form1.sourcelist;
var objobject = form1.objectList;
var sourcelen = objsource.length;
for(var i = 0; i <sourcelen; i ++){
if(objsource.options [i] .selected){
if(!checkexist(objobject、objsource.options [i] .value)){
addtolist(objobject、objsource.options [i] .text、objsource.options [i] .value);
}
}
}
}
関数addalllist()
{
var objsource = form1.sourcelist;
var objobject = form1.objectList;
var sourcelen = objsource.length;
for(var i = 0; i <sourcelen; i ++){
if(!checkexist(objobject、objsource.options [i] .value)){
addtolist(objobject、objsource.options [i] .text、objsource.options [i] .value);
}
}
}
function regyveselectedlist(noremovevalue)
{
var objobject = form1.objectList;
for(var i = 0; i <objobject.length; i ++){
if(objobject.options [i] .selected && objobject.options [i] .value!= noremovevalue)
{
objobject.options.remove(i);
removelist(noremovevalue); break;
}
}
}
関数removealllist(noremovevalue)
{
var objobject = form1.objectList;
var objlen = objobject.length;
for(var i = 0; i <objlen; i ++){
if(objobject.options [i] .value!= noremovevalue){
objobject.options.remove(i);
Removealllist(noremovevalue); break;
}
}
}
function selectedall(obj)
{
for(var i = 0; i <obj.length; i ++){
obj.options [i] .selected = true;
}
}
function checkexist(obj、value)
{
var isexist = false;
for(var i = 0; i <obj.length; i ++){
if(obj.options [i] .value == value){
isexist = true;
壊す;
}
}
ISEXISTを返します。
}
関数addtolist(obj、value、label){
obj.add(new option(value、label));
}
</script>
</head>
<body bgcolor = "#ffffff">
<form name = "form1" action = "temp.asp" method = "post">
<Table CellSpacing = "0" CellPadding = "0">
<tr>
<td> <name = "sourcelist" size = "10"倍数id = "sourcelist">を選択します
<オプション値= "a"> 1 </option>
<オプション値= "b"> 2 </option>
<オプション値= "c"> 3 </option>
<%
i = 6〜20の場合
respons.write( "<option値=" ""&i+200& "" ">"&i+"</option>"&vbcrlf)
次
%>
</select> </td>
<td> <input name = "add" type = "button" id = "add" value = "add" onclick = "addselectedList()"> <br>
<入力name = "add" type = "ボタン" id = "add" value = "ald all" onclick = "addalllist()"> <br>
<入力name = "add" type = "ボタン" id = "add" value = "onclick =" removeselectedList( 'a') "> <br>
<入力name = "add" type = "ボタン" id = "add" value = "all" onclick = "removealllist( 'a')">
<入力name = "add" type = "button" id = "add" value = "alled all" onclick = "selectedall(form1.objectlist)"> </td>
<td> <name = "objectlist" size = "10"倍数id = "objectlist">を選択します
<オプション値= "a"> 1 </option>
<オプション値= "d"> 4 </option>
<オプション値= "e"> 5 </option>
<%
i = 6〜20の場合
Response.write( "<option value =" "&i&" ""> "&i&" </option> "&vbcrlf)
次
%>
</select> </td>
</tr>
<tr>
<td> </td>
<td> <input name = "subm" type = "submit" value = "submit"> </td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>