Forum Moderators: open

Message Too Old, No Replies

Setting selectedIndex to equal text box value

Need index to be set to same value as text box.

         

catcherintherye51

7:20 pm on Jul 24, 2006 (gmt 0)

10+ Year Member



Is there a way to set the selectedIndex in a comboBox to equal the contents of a dynamic text box?

For example, if the comboBox values are:
Red
Green
Blue
White

and the data in the dynamic textbox is "Blue" the comboBox selectedIndex label should be "Blue".

I'm guessing there needs to be a script that cycles through the contents of the comboBox and compares it to whatever is in the dynamic text box. If there's a match, the selectedIndex is set to whatever the index is for the matching label. Make sense?

Any help on this script would be deeply appreciated.

Thanks!

oxbaker

7:25 pm on Jul 24, 2006 (gmt 0)

10+ Year Member



selected index only shows the index position of the item in the list.

ie
RED
GREEN
BLUE
BLACK

blue will be selected index 2 (0,1,2,3)

if you want the name use SelectedItem not selectedIndex.

hth,
mcm

catcherintherye51

9:50 pm on Jul 24, 2006 (gmt 0)

10+ Year Member



Thanks... (a little selectedIndex and selectedItem confusion.) Is there a code that will perform a loop that compares the content of the dynamic text box with the contents of the comboBox, then sets the comboBox accordingly?