Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Senior Member
    Join Date
    Sep 2011
    Location
    South Africa
    Posts
    142
    Member #
    29386
    Hi guys. I am stuck on where to start with the Javascript. I want to move selected items over to the other box but just dont know where to start. Please help me!

    My code is as follows:

    Code:
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Listbox test</title>
    
        <style>
    #container {
        width: 450px;
        height: 112px;
        margin-top: 300px;
        margin-left: auto;
        margin-right: auto;
        border: 1px solid #F30;
        background-color: #F7F7F7;
        -webkit-border-radius: 10px;
        padding:5px;
    }
    </style>
    <script type="text/javascript">
    
    /* <![CDATA[ */
    
    function moveItem() {
          if(moveItem === -1) {
    
            for (var i=0; i < document.forms[0].moveItem; i++) {
    
              document.forms[0].moveItem.add(i).selectedItem;
    
            };
    
            }
    
    };
    
    /* ]]> */
    
    </script>
    </head>
    
    
    
    HTML Code:
    <body>
    <div id="container">
    
    <form action="" method="post" name="moveList">
    
    <table width="450" border="0">
      <tr>
        <td align="center">
        <select name="names_1" size="6" multiple="multiple" id="names">
    
        <option value="charles">Charles</option>
        <option value="craig">Craig</option>
        <option value="lillian" >Lillian</option>
        <option value="brent" >Brent</option>
        <option value="chris">Chris</option>
    
        </select></td>
    
        <td width="100" align="center" ><input name="" onclick="moveItem()" type="button" value="<<" />
        <input name="" onclick="moveItem()" type="button" value=">>" /></td>
    
        <td align="center">
    
        <select name="names_2" size="6" multiple="multiple" id="names">
    
        <option value="angela">Angela</option>
        <option value="karen">Karen</option>
        <option value="patricia">Patricia</option>
        <option value="johnathan" >Johnathan</option>
        <option value="tania" >Tania</option>
    
        </select></td>
      </tr>
    </table>
    
    </form>
    
    </div>
    
    </body>
    
    </html>

  2.  

  3. #2
    Senior Member
    Join Date
    Sep 2011
    Location
    South Africa
    Posts
    142
    Member #
    29386
    Can anyone help me with this?


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

how to move selected list javascript

,

javascript listbox move left right

Click on a term to search for related topics.
All times are GMT -6. The time now is 04:02 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com