Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Multiple Use Select List

    I need to use a Select List of Options (same options) about
    10 or 20 times in a page, and there could be quite a lengthy
    list of options.

    Rather than populate each List on loading, I figured I'd populate
    one internal list in javascript as a base, then and create a blank
    Select List in HTML. When each List is selected for use, I wanted
    to have a javascript routine, move the contents of the internal
    list to the this previously blank list, then do the selection, and on
    blur clear out the list, except for the selected item (optional).

    Is there an easy way to move an entire content of a select
    list to another, without looping through and adding each
    individually?

    Thanks
    George

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    São Paulo, Brazil
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If I understood you corrrectly:
    Code:
    newContainer.innerHTML = baseContainer.innerHTML;
    But this way you will replace the whole <select>.
    /Daniel

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    If you implement that, when the user clicks in and out of the combobox, there would be a delay when populating and deleting the items in the list. That could be a little annoying to the user.

    What you can do is put the combobox in a different page. Then in the main page, have a button that will open the combobox page and when an item is selected, a field in the main page will be set with that item value.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #4
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I thought about using another page for input, but given
    the orignal page layout, it would be worse than a delay.

    I'll give the inner html reference a shot and see how it
    works.

  • #5
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I thought about using another page for input, but given
    the orignal page layout, it would be worse than a delay.

    I'll give the inner html reference a shot and see how it
    works.


  •  

    Posting Permissions

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