|
-
Apr 18th, 2003, 10:12 AM
#1
Thread Starter
Lively Member
Combobox question
I have a combobox in my search form that is created dynamically when the page loads, when a user hits the refresh button to get an updated results total I need to have the values they selected to stay selected. This is the code I am using
Code:
Dim tlist(20) As String
Dim i As Integer
tlist = Split(Request(name), ",")
For i = 0 To 20
f.SelectedIndex = f.Items.Item(tlist(i))
Next
This works great if I only select 1 item, but if I select multiple I get an error. I am using a multi select combobox and thats why I thought I would have to use an array to do it. But I get "Specified argument was out of the range of valid values. Parameter name: 601,1" when I refresh (601,1 being the values I have selected) and it highlights the "Dim tlist(20) as string" line.
"Find all you need in your mind if you take the time" -DT
-
Apr 23rd, 2003, 01:23 PM
#2
Lively Member
Do you actually have 21 items in your list or only 20? If you have only 20, your loop should go from 0 to 19.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|