复制代码代码如下:
<٪
قاتمة أ
A = split (request.form ("sourcelist") ، "،")
Response.write "المصدر:" & request.form ("sourcelist") و Ubound (a) و "<br> الكائن:" & request.form ("ObjectList") و "<br>"
٪>
<html>
<head>
<meta http-equiv = "content-type" content = "text/html ؛ charset = gb2312">
<title> مستند بدون عنوان </title>
<نوع النمط = text/css>
.bgsubleft {
خلفية الوضع: أسفل المركز ؛ صورة الخلفية: url (الصور/bgleft.gif) ؛ تكرار الخلفية: تكرار X.
}
.bgsubleftn {
خلفية الموضع: أسفل اليسار. صورة الخلفية: url (الصور/bgleftn.gif) ؛ تكرار الخلفية: عدم التكرار
}
</style>
<script language = "javaScript" type = "text/javaScript">
وظيفة AddSelectedList ()
{
var objsource = form1.Sourcelist ؛
var objobject = form1.ObjectList ؛
var sourcelen = objsource.length ؛
لـ (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 ؛
لـ (var i = 0 ؛ i <sourcelen ؛ i ++) {
if (! checkexist (objobject ، objsource.options [i] .value)) {
AddToList (objobject ، objsource.options [i] .text ، objsource.options [i] .value) ؛
}
}
}
الوظيفة إزالة LexoSelectedList (NoremoveValue)
{
var objobject = form1.ObjectList ؛
لـ (var i = 0 ؛ i <objobject.length ؛ i ++) {
إذا (objobject.options [i]
{
objobject.options.remove (i) ؛
الإزالة (noremovevalue) ؛ استراحة ؛
}
}
}
الوظيفة الإزالة (NoremoveValue)
{
var objobject = form1.ObjectList ؛
var objlen = objobject.length ؛
لـ (var i = 0 ؛ i <objlen ؛ i ++) {
if (objobject.options [i] .value! = noremovevalue) {
objobject.options.remove (i) ؛
removealllist (NoremoveValue) ؛ استراحة ؛
}
}
}
وظيفة Selectall (OBJ)
{
لـ (var i = 0 ؛ i <obj.length ؛ i ++) {
obj.options [i]. selected = true ؛
}
}
وظيفة checkexist (OBJ ، القيمة)
{
var isexist = false ؛
لـ (var i = 0 ؛ i <obj.length ؛ i ++) {
if (obj.options [i] .value == value) {
isexist = صحيح ؛
استراحة؛
}
}
إرجاع isexist.
}
وظيفة AddToList (OBJ ، القيمة ، التسمية) {
OBJ.Add (خيار جديد (القيمة ، التسمية)) ؛
}
</script>
</head>
<body bgcolor = "#ffffff">
<form name = "form1" action = "temp.asp" method = "post">
<table cellspacing = "0" cellpadding = "0">
<tr>
<td> <select name = "sourcelist" size = "10" multives id = "sourcelist">
<Option Value = "A"> 1 </soph>
<value Option = "B"> 2 </soph>
<Option Value = "C"> 3 </soph>
<٪
لأني = 6 إلى 20
Response.write ("<Option Value =" "" & i+200 & "" ">" & i+200 & "</potion>" & vbcrlf)
التالي
٪>
</select> </td>
<td> <input name = "add" type = "button" id = "add" value = "add" onClick = "AddSelectedList ()"> <br>
<input name = "add" type = "button" id = "add" value = "add all" onClick = "AddAlllist ()"> <br>
<name input = "add" type = "button" id = "add" value = "remove" onClick = "RemovesElectedList ('a')"> <br>
<name input = "add" type = "button" id = "add" value = "remove all" onClick = "removealllist ('a')">
<input name = "add" type = "button" id = "add" value = "select all" onClick = "selectall (form1.objectlist)"> </td>
<td> <تحديد name = "ObjectList" size = "10" id = "ObjectList">
<Option Value = "A"> 1 </soph>
<value Option = "D"> 4 </soph>
<Option Value = "E"> 5 </soph>
<٪
لأني = 6 إلى 20
Response.write ("<Option Value =" "" "& i &" ""
التالي
٪>
</select> </td>
</r>
<tr>
<td> </td>
<td> <input name = "subm" type = "submit" value = "submit"> </td>
<td> </td>
</r>
</table>
</form>
</body>
</html>