<BODY>
<script language="javascript">
<!--
function add(type){
for(i=0;i<document.getElementById("parentselect").options.length;i++)
{
if( document.getElementById("parentselect").options[i].selected == true )
{
flag=true
for(var j=0;j<document.getElementById("childselect").options.length;j++)
{
if(document.getElementById("childselect").options[j].text==document.getElementById("parentselect").options[i].text)
{
flag=false
break;
}
}
if(flag)
document.getElementById("childselect").options.add( new Option( document.getElementById("parentselect")[i].text,document.getElementById("parentselect")[i].value ) );
if( type == 1 )
break;
}
}
}
function remove(type){
if( type==2 )
{
document.getElementById("childselect").options.length=0;
return;
}
for(i=0;i<document.getElementById("childselect").options.length;i++)
{
if( document.getElementById("childselect").options[i].selected == true )
{
document.getElementById("childselect").options.remove(i);
return;
}
}
}
//-->
</script>
<table width="790" border="0" cellpadding="0" cellspacing="0">
  <tr valign="middle">
    <td height="15" colspan="7" align="left" valign="middle"><hr size="1" noshade></td>
  </tr>
  <tr align="center" valign="middle">
    <td height="20" colspan="2" align="right">&nbsp;</td>
    <td width="150" valign="middle">左select</td>
    <td width="85">&nbsp;</td>
    <td>右select</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="center" valign="middle">
    <td height="198" colspan="2" align="right"></td>
    <td align="center" valign="middle"><select name="parentselect" id="parentselect" size="16" multiple>
        <option>北京</option>
        <option>上海</option>
        <option>天津</option>
        <option>纽约</option>
        <option>伦敦</option>
        <option>香港</option>
        <option>巴黎</option>
        <option>等等</option>
      </select>
    </td>
    <td valign="middle"><p class="button1">
        <input name="search23" type="button" class="input0" id="search232" value="添加多个" onclick="add(type)">
        <br>
        <input name="search2" type="button" class="input0" id="search25" value="添加单个" onclick="add(1)">        
        <br>
        <input name="search222" type="button" class="input0" id="search2223" value="删除单个" onclick="remove(1)">
        <br>
        <input name="search22" type="button" class="input0" id="search224" value="全部删除" onclick="remove(2)">
      </p>
      </td>
    <td align="center" valign="middle"><select name="childselect" id="dest" size="16" multiple>
      </select>
    </td>
  </tr>
</table>
</BODY>

解决方案 »

  1.   

    <script>
    /*
    函数说明:将一个select中的内容导出到另一个select中。
    selectPara1:要导出的select
    selectPara2:要导进的select
    */
    function selectPara1_OnDblClick()
    {
    var obj1 = document.getElementById("selectPara1").options;
    var obj2 = document.getElementById("selectPara2").options;

    for(var itemID = 0; itemID < obj1.length; itemID++)
    {
    if(obj1[itemID].selected == true)
    {
    if(!isValueOfSelect(obj1[itemID].text))
    document.all.selectPara2.add(new Option(obj1[itemID].text, obj1[itemID].value));
    }
    }
        }

    function isValueOfSelect(val)
    {
    var obj = document.getElementById("selectPara2").options;
    if(obj.length > 0)
    {
    for(var k=0;k<obj.options.length;k++)
    {
    if(obj.options[k].text == val)
    {
    return true;
    }
    }
    }
    return false;
    }

    function selectPara2_OnDblClick()
    {
    var obj = document.getElementById("selectPara2").options
    for(var itemID = 0; itemID < obj.length; itemID++)
    {
    if(obj[itemID].selected == true)
    document.all.selectPara2.remove(itemID);
    }
    }
    </script>
    <html>
    <body>
    <table id="machineInfo" width="100%" bgColor="#cccccc" border="0">
    <tr>
    <td height="24">&nbsp;Select</td>
    </tr>
    <tr height="20">
    <td width="18%" align="center" valign="middle" bgcolor="#ffffff">
    <img src="./images/rd_icon_aa.jpg">
    </td>
    <td width="35%" class="content_ssxt" align="center">&nbsp;
    <select id="selectPara1" size="8" multiple ondblclick="selectPara1_OnDblClick();" runat="server">
    <option>一</option>
    <option>二</option>
    <option>三</option>
    <option>四</option>
    <option>五</option>
    </select>
    </td>
    <td width="35%" class="contentsstext" align="center">
    <select id="selectPara2" size="8" multiple ondblclick="selectPara2_OnDblClick();" style="WIDTH: 200px"
    runat="server">
    </select>
    </td>
    <td class="contenss_text" align="right" valign="bottom">
    <table width="100%">
    <tr>
    <td width="20">&nbsp;</td>
    <td class="text_button">
    <asp:LinkButton ID="lnkBtnCreate" CssClass="text_bssink" Runat="server">Submit</asp:LinkButton>
    </td>
    <td width="20">&nbsp;</td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </body>
    </html>
    你根据这个改改看。
    我只是把左边的东西放到右边,但还保留左边。