www.webdeveloper.com
Results 1 to 6 of 6

Thread: Dynamically Create a Select Listbox

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Posts
    3

    Dynamically Create a Select Listbox

    I am attempting to make a form for people to enter football (soccer) scores and scorers.

    For this I need a drop down box for each goal scored so that the scorers can be selected, although this could be done using PHP it would be slow and with the amounts of results to be added it would probably be a bad move.

    So how could I use javascript to make a new listbox appear everytime the user clicks the "Add Goal" button(for example) and remove one when the user clicks "remove".

    The names would also have to be something like goal1 goal2 goal3 etc.

  2. #2
    Join Date
    Jun 2006
    Posts
    3
    I know we're not supposed to bump - but it moved to the second page without any replies


    Theres a few ways it could work, it could add a new box with no contents(and a value of 0) every time something is selected in the original box, or it could have add/remove boxes, etc.

    Please? anyone?

  3. #3
    Join Date
    Feb 2006
    Location
    Where I live, people get shot. I need to move.
    Posts
    634
    Theyre all prolly watching the footie.

    http://www.webdeveloper.com/forum/sh...d.php?t=111125

    This may help you start off, the method is scripted so it should give you an Idea how to populate a select tag with data...
    If life gives you a hard knock once in a while, your lucky. All I keep getting is a savage beating... everyday!
    AJAX! - Javascript Sha1 & MD5 - ASCII tables - Zend DevZone - My Space
    Stop Badware - Create "TEXT FILE" in Javascript - . - wikipedia on PHP -

  4. #4
    Join Date
    Jun 2006
    Posts
    3
    I dont want to populate it with data, I want to actually create a new select box.

    Apparently createElement or something could be used for this, I tried looking it up but got nowhere, anyone know anything about that?

  5. #5
    Join Date
    Feb 2006
    Location
    Where I live, people get shot. I need to move.
    Posts
    634
    If life gives you a hard knock once in a while, your lucky. All I keep getting is a savage beating... everyday!
    AJAX! - Javascript Sha1 & MD5 - ASCII tables - Zend DevZone - My Space
    Stop Badware - Create "TEXT FILE" in Javascript - . - wikipedia on PHP -

  6. #6
    Join Date
    Nov 2012
    Posts
    1
    hi,

    somebody suggest me that how can i generate new list box with value when i click one value of previous list box value.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles