-
Find item in drop down list and select it?
I’m trying to programmatically select a drop down item by text, not by index number.
This works great:
myDropDownList.selection = 1;
But I can’t seem to select by text, like this:
myDropDownList.selection.text = “This Text”;
Furthermore, I can’t seem to use indexOf to find the text in the dropdown’s array. Like this:
myItemNumber = myDropDownList.items.indexOf(“This Text”);
myDropDownList.selection = myItemNumber;In fact, indexOf seems to just work on a variable, not on an array.
I know I can loop through the whole array, testing each item to see if it matches, but I’m curious about doing it the correct way.
Thanks for any help!
Mitch