分享

两个SELECT互相传值

 星爷 2006-03-25

<!doctype html public "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www./TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www./1999/xhtml" lang="gb2312">
<head>
<title> new document </title>
<meta http-equiv="content-type" content="text/html;" />
<meta name="generator" content="editplus" />
<meta name="author" content="cnlei,枫岩,www.cnlei.net" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<link type="text/css" rel="stylesheet" href="" />
</head>
<script type="text/javascript">
 <!--
function Mv(a,b) {
var i = 0;
var f=document.getElementById(a);
var t=document.getElementById(b);
for(var i=0; i<f.options.length; i++) {
if(f.options[i].selected ) {
var no = new Option();
no.value = f.options[i].value;
no.text = f.options[i].text;
t.options[t.options.length] = no;}
}
Rv(a);
}

function Rv(o) {
var o=document.getElementById(o);
for(var i=o.options.length-1; i>=0; i--) {
if(o.options[i].selected && o.options[i] != "") {
 o.options[i].value = "";
 o.options[i].text = "";
 o.options[i] = null;
 }
}
}
-->
</script>
<body>
<table id="MovOpTB" cellspacing="0" cellpadding="0">
<tr>
  <td class="slt"><strong class="norTit">我的联系人</strong><br /><select id="SltAddrA" class="SltBar" name="" size="12"  multiple="true">
    <option value="1">CNLei01 <test@test.com></option>
    <option value="2">CNLei02 <test@test.com></option>
    <option value="5">CNLei05 <test@test.com></option>
    <option value="7">CNLei07 <test@test.com></option>
    <option value="9">CNLei09 <test@test.com></option>
    <option value="9">CNLei10 <test@test.com></option>
    <option value="11">CNLei11 <test@test.com></option>
  </select>
  </td>
  <td class="btn"><input type="button" class="BtnA2w" name="" value=">>>" onclick="Mv(‘SltAddrA‘,‘SltAddrB‘);" /><br /><br /><input type="button" class="BtnB2w" name="" value="<<<" onclick="Mv(‘SltAddrB‘,‘SltAddrA‘);" /></td>
  <td class="slt"><strong class="norTit">列表成员</strong><br /><select id="SltAddrB" class="SltBar" name="" size="12" multiple="true">
    <option value="">CNLei03 <test@test.com></option>
    <option value="">CNLei04 <test@test.com></option>
    <option value="">CNLei08 <test@test.com></option>
  </select></td>
</tr>
</table>
</body>
</html>

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多