复制代码 代码如下:
<%
dim a
a = split(Request.Form("sourceList"),",")
Response.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>Untitled Document</title>
<STYLE type=text/css>
.bgsubleft {
BACKGROUND-POSITION: center bottom; BACKGROUND-IMAGE: url(images/bgleft.gif); BACKGROUND-REPEAT: repeat-x
}
.bgsubleftn {
BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: url(images/bgleftn.gif); BACKGROUND-REPEAT: no-repeat
}
</STYLE>
<script language="JavaScript" type="text/JavaScript">
function 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);
}
}
}
}
function 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 removeSelectedList(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;
}
}
}
function 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;
break;
}
}
return isExist;
}
function addtolist(obj,value,label){
obj.add(new Option(value,label));
}
</script>
</head>
<body bgcolor="#FFFFFF">
<form name="form1" action="temp.asp" method="post">
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><select name="sourceList" size="10" multiple id="sourceList" style="width:150">
<option value="a">1</option>
<option value="b">2</option>
<option value="c">3</option>
<%
for i = 6 to 20
Response.Write("<option value=""" & i+200 & """>" & i+200 & "</option>" & vbcrlf)
Next
%>
</select></td>
<td><input name="add" type="button" id="add" value="Add" onclick="addSelectedList()" style="width:100"><br>
<input name="add" type="button" id="add" value="Add all" onclick="addAllList()" style="width:100"><br>
<input name="add" type="button" id="add" value="Remove" onclick="removeSelectedList('a')" style="width:100"><br>
<input name="add" type="button" id="add" value="Remove all" onclick="removeAllList('a')" style="width:100">
<input name="add" type="button" id="add" value="Select all" onclick="selectedAll(form1.objectList)" style="width:100"></td>
<td><select name="objectList" size="10" multiple id="objectList" style="width:150">
<option value="a">1</option>
<option value="d">4</option>
<option value="e">5</option>
<%
for i = 6 to 20
Response.Write("<option value=""" & i & """>" & i & "</option>" & vbcrlf)
Next
%>
</select></td>
</tr>
<tr>
<td></td>
<td><input name="subm" type="submit" value="Submit" style="width:100"></td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
列表框,添加,移动,删除
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- Rachmaninoff-SuitesNos.12,TheSleepingBeauty-MikuOmine,TakakoTakahashi(2024)[24-
- 童丽《影视金曲(1:1黄金母盘版)》[WAV]
- 柏菲·胭花四乐《胭花四乐》限量开盘母带ORMCD[低速原抓WAV+CUE]
- 群星《监听耳机天碟》2018[WAV分轨][1G]
- 群星《娱协奖原创金曲合辑》滚石[WAV+CUE][1.1G]
- 罗大佑《美丽岛》2CD[WAV+CUE][1.1G]
- 言承旭.2009-多出来的自由【SONY】【WAV+CUE】
- 赤道.2000-精选2CD【ACM】【WAV+UCE】
- 许廷铿.2017-神奇之旅【华纳】【WAV+CUE】
- 李克勤《罪人》环球[WAV+CUE][1G]
- 陈粒2024《乌有乡地图》有此山文化[FLAC分轨][1G]
- 蔡依林《MYSELF》 奢华庆菌版 2CD[WAV+CUE][1.5G]
- 刘春美《心与心寻世界名曲中文版》新京文[低速原抓WAV+CUE]
- 朱逢博《蔷薇蔷薇处处开》[FLAC+CUE]
- 姚璎格2005《心在哭泣》龙韵[WAV分轨]