PDA

View Full Version : Dynamically setting a combo box


llebron
03-15-2005, 05:02 PM
I have a dynamically generated combo box that has companyID as data and companyNames as labels. This is part of a movie that retrieves user information from a database. I want to be able to set the combo box so that it matches the user's information in the database table. So that if the users companyID=NN, I can set the combo box to the item whose data=NN. I have looked through the livedocs and a couple of different sites but I am still stuck.


thanks,

Luis

SrinivasSM
03-16-2005, 07:31 AM
What ever your problem is not so clear for me if you can give me the exact Picture of where u r facing problem then i hope i can solve ur problem

llebron
03-17-2005, 02:21 PM
The following code did the trick:

for( var ivar=0;ivar < mc_cb.dropdown.length;ivar++) {
if( users_company_id == mc_cb.getItemAt(ivar).data) {
mc_cb.selectedIndex = ivar;
break;
}


thanks,

Luis