zoukankan
html css js c++ java
如何在客户端对ListBox进行添加删除操作
ListBox的客户端添加删除操作
<%
@ Page language
=
"
c#
"
Codebehind
=
"
WebForm1.aspx.cs
"
AutoEventWireup
=
"
false
"
Inherits
=
"
WebExample.WebForm1
"
%>
<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
>
<
HTML
>
<
HEAD
>
<
title
>
WebForm1
</
title
>
<
meta
name
="GENERATOR"
Content
="Microsoft Visual Studio .NET 7.1"
>
<
meta
name
="CODE_LANGUAGE"
Content
="C#"
>
<
meta
name
="vs_defaultClientScript"
content
="JavaScript"
>
<
meta
name
="vs_targetSchema"
content
="http://schemas.microsoft.com/intellisense/ie5"
>
<
script
>
function
Add()
{
var
elemAll
=
document.getElementById(
"
lbAll
"
);
var
elemSel
=
document.getElementById(
"
lbSel
"
);
for
(
var
i
=
0
;i
<
elemAll.options.length;i
++
)
{
if
(elemAll.options[i].selected)
{
var
SelText
=
elemAll.options[i].innerText;
var
SelValue
=
elemAll.options[i].value;
var
Num
=
elemSel.options.length;
elemSel.options[Num]
=
new
Option(SelText,SelValue);
elemAll.options.remove(i);
i
--
;
}
}
}
function
Remove()
{
var
elemAll
=
document.getElementById(
"
lbAll
"
);
var
elemSel
=
document.getElementById(
"
lbSel
"
);
for
(
var
i
=
0
;i
<
elemSel.options.length;i
++
)
{
if
(elemSel.options[i].selected)
{
var
SelText
=
elemSel.options[i].innerText;
var
SelValue
=
elemSel.options[i].value;
var
Num
=
elemAll.options.length;
elemAll.options[Num]
=
new
Option(SelText,SelValue);
elemSel.options.remove(i);
i
--
;
}
}
}
</
script
>
</
HEAD
>
<
body
>
<
form
id
="Form1"
method
="post"
runat
="server"
>
<
TABLE
>
<
TR
>
<
TD
>
<
asp:ListBox
id
="lbAll"
runat
="server"
Width
="100px"
Height
="150px"
SelectionMode
="Multiple"
></
asp:ListBox
></
TD
>
<
TD
>
<
INPUT
id
="btnAdd"
type
="button"
value
=">>"
onclick
="Add();"
><
br
>
<
INPUT
id
="btnRemove"
type
="button"
value
="<<"
onclick
="Remove();"
>
</
TD
>
<
TD
>
<
asp:ListBox
id
="lbSel"
runat
="server"
Width
="100px"
Height
="150px"
SelectionMode
="Multiple"
></
asp:ListBox
></
TD
>
</
TR
>
</
TABLE
>
</
form
>
</
body
>
</
HTML
>
查看全文
相关阅读:
JMeter4.0的单机压测和集群压测简介
接口自动化测试,完整入门篇
jmeter实战---正则提取器
压测必经之路,解读JMeter分布式
JMeter线程组参数含义
jmeter生成HTML性能测试报告
SPP-Net、Atrous Convolution以及ASPP by Rose
使用CNN进行角度估计
Java相关书籍分享
Code Conventions for the Java
原文地址:https://www.cnblogs.com/newwind521/p/483816.html
最新文章
.Net生成导出Excel
将实体转换为Hashtable
JQuery对象函数
sqlserver常用函数
PARTITION BY函数
sqlserver排名函数
asp.net2.0安全性(4)--Login系列控件--转载来自车老师
asp.net2.0安全性(3)--验证与授权--转载来自车老师
asp.net2.0安全性(2)--用户个性化设置(2)--转载来自车老师
asp.net2.0安全性(2)--用户个性化设置(1)--转载来自车老师
热门文章
asp.net2.0安全性(1)--用户角色篇(代码实现2)--转载来自车老师
asp.net2.0安全性(1)--用户角色篇(代码实现1)--转载来自车老师
asp.net2.0安全性(1)--用户角色篇(类)--转载来自车老师
asp.net2.0安全性(1)--用户角色篇(起篇)--转载来自车老师
如果当前窗口的父窗口的窗口不是个顶级窗口就让页面跳转回到登录页
字符串函数、数据类型转换函数、连接查询
逻辑运算符
数据库中的数据类型
压力测试常遇到的问题及解决方法
线上问题解决方案
Copyright © 2011-2022 走看看