Results 1 to 2 of 2

Thread: Multiple Select Field Copyer

  1. #1
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default Multiple Select Field Copyer

    Hello,
    How would you Copy all the options in one "multiple" select field and put them into another one. By "Multiple" I mean: <select size=5>... not chained select feilds. Basicly, What I origanally tryed was:
    Code:
     document.dwn.DownloadList.options = document.theform.PickList.options
    But It did not work. Any Questions will be answerd.
    Thanks.
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script type="text/javascript">
    function dupe_opts(dd1, dd2){
    for (var i = 0; i < dd1.options.length; i++)
    dd2.appendChild(dd1.options[i].cloneNode(true));
    }
    </script>
    </head>
    <body>
    <form action="#">
    <select name="one" size=5>
    <option value="">first</option>
    <option value="">second</option>
    <option value="">third</option>
    <option value="">forth</option>
    <option value="">fifth</option>
    <option value="">sixth</option>
    <option value="">seventh</option>
    <option value="">eighth</option>
    </select><br>
    <input type="button" value="Dupe" onclick="dupe_opts(this.form.one, document.forms[1].two);">
    </form>
    <form action="#">
    <select name="two">
    </select>
    </form>
    </body>
    </html>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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