select 左右多选实现
来源:互联网 发布:花生壳赠送的免费域名 编辑:程序博客网 时间:2024/05/16 07:23
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript">
function $(e){return document.getElementById(e);}
function PutRightOneClk(str) {
if($(str+"0").options.selectedIndex == -1){return false;}
while($(str+"0").options.selectedIndex > -1){
var id = $(str+"0").options.selectedIndex
var varitem = new Option($(str+"0").options[id].text,$(str+"0").options[id].value);
$(str+"1").options.add(varitem);
$(str+"0").options.remove(id);
}
}
function PutRightAllClk(str) {
if($(str+"0").options.length == 0){return false;}
for(var i=0;i<$(str+"0").options.length;i++){
var varitem = new Option($(str+"0").options[i].text,$(str+"0").options[i].value);
$(str+"1").options.add(varitem);
}
$(str+"0").options.length = 0;
}
function PutLeftOneClk(str) {
if($(str+"1").options.selectedIndex == -1){return false;}
while($(str+"1").options.selectedIndex > -1){
var id = $(str+"1").options.selectedIndex
var varitem = new Option($(str+"1").options[id].text,$(str+"1").options[id].value);
$(str+"0").options.add(varitem);
$(str+"1").options.remove(id);
}
}
function PutLeftAllClk(str){
if($(str+"1").options.length == 0){return false;}
for(var i=0;i<$(str+"1").options.length;i++){
var varitem = new Option($(str+"1").options[i].text,$(str+"1").options[i].value);
$(str+"0").options.add(varitem);
}
$(str+"1").options.length = 0;
}
</script>
</head>
<body>
<table>
<tr>
<td width="20%" class="biaoti-2" align="right">标签:</td>
<td class="formword" colspan="3" width="80%">
<div style="float:left;">
<select size="5" id="ptNbrs0" class="input" style="width:200px;height:200px;" multiple="multiple" ondblclick="PutRightOneClk('ptNbrs')">
<option value="0" >qqqq</option>
<option value="1" >wwww</option>
<option value="2" >eeee</option>
</select>
</div>
<div style="float:left">
<input type="button" value=" > " id="PutRightOne" class="button1" onclick="PutRightOneClk('ptNbrs')" /><br /><br />
<input type="button" value=">>" id="PutRightAll" class="button1" onclick="PutRightAllClk('ptNbrs')" /><br /><br />
<input type="button" value=" < " id="PutLeftOne" class="button1" onclick="PutLeftOneClk('ptNbrs')" /><br /><br />
<input type="button" value="<<" id="PutLeftAll" class="button1" onclick="PutLeftAllClk('ptNbrs')" />
</div>
<div>
<select size="5" id="ptNbrs1" name="ptNbrs1" class="input" style="width:200px;height:200px;" multiple="multiple" ondblclick="PutLeftOneClk('ptNbrs')">
</select>
</div>
</td>
</tr>
</table>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript">
function $(e){return document.getElementById(e);}
function PutRightOneClk(str) {
if($(str+"0").options.selectedIndex == -1){return false;}
while($(str+"0").options.selectedIndex > -1){
var id = $(str+"0").options.selectedIndex
var varitem = new Option($(str+"0").options[id].text,$(str+"0").options[id].value);
$(str+"1").options.add(varitem);
$(str+"0").options.remove(id);
}
}
function PutRightAllClk(str) {
if($(str+"0").options.length == 0){return false;}
for(var i=0;i<$(str+"0").options.length;i++){
var varitem = new Option($(str+"0").options[i].text,$(str+"0").options[i].value);
$(str+"1").options.add(varitem);
}
$(str+"0").options.length = 0;
}
function PutLeftOneClk(str) {
if($(str+"1").options.selectedIndex == -1){return false;}
while($(str+"1").options.selectedIndex > -1){
var id = $(str+"1").options.selectedIndex
var varitem = new Option($(str+"1").options[id].text,$(str+"1").options[id].value);
$(str+"0").options.add(varitem);
$(str+"1").options.remove(id);
}
}
function PutLeftAllClk(str){
if($(str+"1").options.length == 0){return false;}
for(var i=0;i<$(str+"1").options.length;i++){
var varitem = new Option($(str+"1").options[i].text,$(str+"1").options[i].value);
$(str+"0").options.add(varitem);
}
$(str+"1").options.length = 0;
}
</script>
</head>
<body>
<table>
<tr>
<td width="20%" class="biaoti-2" align="right">标签:</td>
<td class="formword" colspan="3" width="80%">
<div style="float:left;">
<select size="5" id="ptNbrs0" class="input" style="width:200px;height:200px;" multiple="multiple" ondblclick="PutRightOneClk('ptNbrs')">
<option value="0" >qqqq</option>
<option value="1" >wwww</option>
<option value="2" >eeee</option>
</select>
</div>
<div style="float:left">
<input type="button" value=" > " id="PutRightOne" class="button1" onclick="PutRightOneClk('ptNbrs')" /><br /><br />
<input type="button" value=">>" id="PutRightAll" class="button1" onclick="PutRightAllClk('ptNbrs')" /><br /><br />
<input type="button" value=" < " id="PutLeftOne" class="button1" onclick="PutLeftOneClk('ptNbrs')" /><br /><br />
<input type="button" value="<<" id="PutLeftAll" class="button1" onclick="PutLeftAllClk('ptNbrs')" />
</div>
<div>
<select size="5" id="ptNbrs1" name="ptNbrs1" class="input" style="width:200px;height:200px;" multiple="multiple" ondblclick="PutLeftOneClk('ptNbrs')">
</select>
</div>
</td>
</tr>
</table>
</body>
</html>
0 0
- select 左右多选实现
- Jquery实现SELECT多选并且左右上下移动
- jquery实现select多选框的左右移动
- jQuery 实现左右Select列表数据互换
- 左右select选择 (jQuery实现)
- Select JQuery 实现左右复制移动内容
- select实现多选
- js 实现的左右多选控件
- js与select实现左右option的交换删除
- jQuery学习: 实现select multiple左右添加和删除功能
- 实现select multiple左右添加和删除功能
- jquery实现select框内容的左右移动【经典】
- Jquery实现select multiple左右添加和删除功能
- JavaScript实现左右Select列表框交换数据
- jQuery实现select下拉框左右选择_交换内容
- jQuery实现select多选框左右添加,包括双击事件
- select列表左右内容交换的JS代码,支持同时多选
- select 左右移动
- CUDA安装
- jsoncpp
- Cocos2d-x教程(7)-动作
- Eclipsse 的一些使用小技巧
- Node.js v0.10.31API手册-子进程
- select 左右多选实现
- WinDbg调试dump文件
- Axis2 Web Service(三)
- IIS,什么东东
- 分布式搜索Elasticsearch——创建客户端(四)
- 支持对话框控件
- 未能加载文件或程序集“App_Web_ckqi_ppf, Version=0.0.0.0, Culture=neutral...
- ACM大牛blog
- python读文件open file 中文乱码问题