多选列表框动态添加多选列表框动态添加,移动移动,删除删除,全选等操作的简单实例全选等操作的简单实例
代码如下:
<%
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)
评论0
最新资源