»
EnglishFrenchVietnamese

Print - ListBox Items Exchange - JavaScriptBank.com

Full version: jsB@nk » Form » Dropdown » ListBox Items Exchange
URL: https://www.javascriptbank.com/listbox-items-exchange.html

ListBox Items Exchange © JavaScriptBank.comThe code can be used to exchange value between 2 list box.

Full version: jsB@nk » Form » Dropdown » ListBox Items Exchange
URL: https://www.javascriptbank.com/listbox-items-exchange.html



JavaScript
<script language="JavaScript">function assign(aSel, uSel) {for (i=0;i<uSel.options.length;i++)if (uSel.options[i].selected) {aSel.options[aSel.options.length] = new Option(uSel.options[i].text, uSel.options[i].value);uSel.options[i--] = null;}if (document.layers && !document.getElementById)history.go(0);}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<table align="center">  <tbody>  <tr>    <td align="center">      <h1>Here goes Victor&#39;s work !</h1>      <br>      ListBox Items Exchange<br>      IE(4.x,5.x,6.x) &amp; NN(4.x,6.x)</td>  </tr>  <tr>    <td align="center">      <form name="hostform" method="post" action="">        <table border="0" width="543" height="169">          <tbody><tr>             <td rowspan="2" width="248">               <div align="center">Assigned<br>                <select name="assigned" size="10" multiple="multiple"><option value="1">but</option><option value="3">nothing</option><option value="4">are</option><option value="5">a genius</option><option value="2">you</option></select>              </div>            </td>            <td height="78" width="38">               <div align="center">                 <input type="button" name="Submit2" value="&gt;&gt;" onclick="assign(document.hostform.unassigned,document.hostform.assigned)">              </div>            </td>            <td rowspan="2" width="261">               <div align="center">Unassigned<br>                <select name="unassigned" size="10" multiple="multiple"></select>              </div>            </td>          </tr>          <tr>             <td width="38">               <div align="center">                 <input type="button" name="Submit" value="&lt;&lt;" onclick="assign(document.hostform.assigned,document.hostform.unassigned)">              </div>            </td>          </tr>          <tr>             <td colspan="3">               <div align="center"></div>                          </td>          </tr>        </tbody></table>      </form>    </td>  </tr>  <tr>    <td align="center"><br>Designer: <b>Liming Weng(Chinese)</b><br>Copyright Reserved, 2001<br><br>It is a emailware. If you love it, please mail and commend me!<br>Emailto: victorwon@netease.com    </td></tr>  <tr><td align="left">    <br><br>    </td>  </tr>  </tbody></table><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->