You don't really need to totally scrap the code, you just need to tweak it differently.
On a webpage to select a particular option in a dropdown you normally set the selectedIndex.
The selectedIndex is not the value you want, it's the index, or position, of that value in the list of items the dropdown displays.
Also, and this is quite important, the index of a dropdown is 0-based which means the 1st item has index 0, the s2nd index 1, the 3rd index 2 and so on.
As for FireEvent, that would be used when there was code for the dropdown that you needed to execute.
For example, if you had dependent dropdowns there might be code in one dropdown that updates what's listed in another dropdown list based on what was selected in the first.
Oh, just remembered something else - there is no getElementByName.
Sorry, should have mentioned that right away.
Bookmarks