SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast spambler's Avatar
    Join Date
    Mar 2003
    Location
    England
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Select all values in list box

    I have a form with a "results" list box for a sort user defined sort

    Lets say the values are:

    Field 1 (ASC)
    Field 2 (ASC)
    Field 3 (DESC)

    What I want to do is automatically select all these values before submitting the form so I can pass every list box value to the next form whether selected or not.

    Depending on the number of values in the list box I think I need something like this:

    // COUNT OF ROWS FROM ZERO
    MYROWS = document.choiceForm.choiceBox.length
    MYROWS = MYROWS - 1

    for (i = 0; i <= MYROWS; i++)
    {
    document.choiceForm.choiceBox. ?????????????????????? Code here <<<<

    }


  2. #2
    SitePoint Enthusiast spambler's Avatar
    Join Date
    Mar 2003
    Location
    England
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's ok folks. I've managed it.

    here's the line I needed help with. Hope this is useful for others!

    document.choiceForm.choiceBox.options[i].selected = true




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
  •