I've got an array containing names of select boxes:
I populate these select boxes from a database:
the "25" in this example is the database ID field.
<select name="FirstName" onChange="updateEmployeeFields(this.options[this.selectedIndex].value)">
<select name="Surname" onChange="updateEmployeeFields(this.options[this.selectedIndex].value)">
When a user chooses, say, a first name, I want any other select boxes on the page that are populated from the same database data to change to reflect that. If I select "Bill" in the FirstName, I want the Surname to change to "Gates". It shouldn't be too hard because their index values are both gonna be 25.
Here's the function I call onChange:
which - should - loop through all the relevant select box names and make their selectedIndex whatever was sent to it in "whichIndex". Right?
All it does is sets all the relevant select boxes - those in my array - to blank, and I'm not sure why. Any suggestions?