问题1:当点击“删除”按钮后,响应的事件是listbox里的内容全部删除。
问题2:有两个listbox1,listbox2,在listbox1中选中多条内容后,点击“选择”按钮,则被选中的内容会添加到listbox2中,问题是在listbox1中多选时,点shift按钮供用户选择多选,那么该处的代码如何实现?请高手帮忙,这块我实在不会啊!
问题2:有两个listbox1,listbox2,在listbox1中选中多条内容后,点击“选择”按钮,则被选中的内容会添加到listbox2中,问题是在listbox1中多选时,点shift按钮供用户选择多选,那么该处的代码如何实现?请高手帮忙,这块我实在不会啊!
解决方案 »
- EnableEventValidation="false"做什么用的?
- .NET 和 J2EE目前 哪个就业形势好啊
- <项目>
- listview中每一行定时自动移动要怎么实现?
- 界面设计
- 自己建的DataTable能否填加到以有的数据库表中?
- DataGrid问题:我点编辑后,如何控制编辑行中每个TEXTBOX宽度?散分!
- 我都不好意思问了,脸皮比城墙转拐拐还厚,有请hgknight、webdiyer、Lostinet、acewang斑主给一段实例吧?
- 关于在客户端的函数调用的及和服务器端交互的问题,不知所措,请高手指教,表示感谢了!!!!
- 在ASP.Net中怎么用PerformanceCounter阿
- 怎么把图片的某一部分发送到客户端
- listbox小问题???在线等!!!!
服务端: listbox.Items.Clear()
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
function addSrcToDestList() {
destList = window.document.forms[0].destList;
srcList = window.document.forms[0].srcList;
var len = destList.length;
for(var i = 0; i < srcList.length; i++) {
if ((srcList.options[i] != null) && (srcList.options[i].selected)) {var found = false;
for(var count = 0; count < len; count++) {
if (destList.options[count] != null) {
if (srcList.options[i].text == destList.options[count].text) {
found = true;
break;
}
}
}
if (found != true) {
destList.options[len] = new Option(srcList.options[i].text);
len++;
}
}
}
}function deleteFromDestList() {
var destList = window.document.forms[0].destList;
var len = destList.options.length;
for(var i = (len-1); i >= 0; i--) {
if ((destList.options[i] != null) && (destList.options[i].selected == true)) {
destList.options[i] = null;
}
}
}
// -->
</SCRIPT>
</head>
<body>
<center>
<form method="POST">
<table bgcolor="#FFFFCC"><tr>
<td bgcolor="#FFFFCC" width="85">
<select size="6" name="srcList" multiple>
<option value="1">Item 1
<option value="2">Item 2
<option value="3">Item 3
<option value="4">Item 4
<option value="5">Item 5
<option value="6">Item 6
</select>
</td>
<td bgcolor="#FFFFCC" width="74" align="center">
<input type="button" value=" 增加到右边 " onClick="javascript:addSrcToDestList()">
<br><br>
<input type="button" value=" 从右边删除 " onclick="javascript:deleteFromDestList();">
</td>
<td bgcolor="#FFFFCC" width="69">
<select size="6" name="destList" multiple>
</select>
</td>
</tr>
</table>
</form>
</body>
</html>
或用一个循环
这可能是我这个月最后一次来这里回答问题了
下周一公司就要封闭开发了。是PB
郁闷ing