Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box List 1

Status
Not open for further replies.

mrathi

Technical User
Oct 27, 2003
115
0
0
US
Hi, I want to know if it is possible to do the following with the combo box list and if it is, I would appreciate if someone tells me how to. Thanks

I have a combobox list with 5 items in it. If the first item in the list is selected, I do not want the user to select additional items until he unchecks the first one. If the first item is not checked, the user can select either one, two, three or four of the remaining. Also, how can I get the values of the items if multiple items selected.

Thanks
 
You could only stop the user selecting another item in javascript unless you did a postback each time an item is selected (you could do this by just setting the AutoPostBack to true and seeing if any other items are selected).

To get each item that is selected you can just loop through the items and check if it is selected. e.g.
Code:
Dim li As ListItem
For Each li In ListBox1.Items
	If li.Selected = True Then ...
Next

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top