Results 1 to 3 of 3

Thread: Basic ? about drop down box

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Posts
    67

    Post

    I want to display the selected items of a multiple option
    drop down box but i don't know how.

    as an example
    i have 5 items in my drop down box
    item1
    item2 <- Selected
    item3
    item4 <- Selected
    item5

    And i want to be able to display something like
    You chose :
    -item2
    -item3

    Can some one help me?

  2. #2
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    all the selected items form a collection.

    you access these items as follows:
    Code:
    myString = Request.form("listname")(2)
    which will give you the second selected item.

    Here's a little code which will populate an array with all the selected items in a list:

    Code:
    <%
    
    Dim arrayOptions()
    intCount = 0
    
    For Each SubKey in Request.form("list1")
    
    	ReDim Preserve arrayOptions(intCount + 1)
    	intCount = intCount + 1
    	arrayOptions(intCount) = Request.form("list1")(intCount)
    
    Next
    
    %>
    you can then loop through this array to get all the selected items.

    Hope this helps!!

    dvst8


  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Posts
    67
    Thanks it helped very much!

    But now i have another question!

    How can i by clicking on a button select all items
    of the multiple option drop down box?

Posting Permissions

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



Click Here to Expand Forum to Full Width