Multiple DropDown list on a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have 5 different Dropdown lists on a form. There is no need to select an
item in every one , at least one but could be all 5. I have a Submit buttom
- how do I grab all all SelectedIndexChanged? Any ideas ?-
Tjalle
 
Hi Tjalle
I don't know if I got you correct, but if it doesn't matter which
one was clicked ( one or all ) , then you can have one handler function
for all the SelectedIndexChanged of the five of them .In this handler you
get the new index of all of them ( if one didn't change you will get the
old already existing one which should be no problem) you get all these
values and what ever logic you do on them . Now that you have that one
hander function , you can associate it with the delegate of the event of
each list. This way you will have all the five events handled with the same
function. Hope this helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Tjalle,

It is not clear what you are trying to do. You mention forms in your post,
but DropDownList is a web component - are you using Windows Forms or ASP.NET?

Either way, I would suggest that you use the same SelectedIndexChanged
handler for all the dropdownlists (or comboboxes). For ASP.NET make sure you
set AutoPostBack to true. In this handler you can check the selected index
for each of the controls and enable/disable the Submit button appropriately.

HTH,
Chris.
 
Back
Top