Ok

I have the folowing situation. 2 combobox in a form and each combo makes a search in a database to fill it in. The problem is that the 2 combos are linked in a way that the option in one specifies the content of the other. So I put the following code in the first one:

function envia_cod3() {
// Get the selected Item in the first combo
cod_esp = especie.getSelectedItem().data;
// Calls the script to search the database based on the line before
loadVariablesNum("raca.php", "0", "POST");
// Remove all items in the second combo
raca.removeAll ();
// Add the first item (fixed item)
raca.addItem("Escolha");
// Add each Item from the search
for (i=1; i<=targetCount; i++) {
var item = eval("cod_raca"+i);
var item2 = eval("raca"+i);
raca.addItem(item2, item);
}
}

The problem is that I have to select the Item in the first combo twice, to the second combo to be filled.

How do I Refresh the combobox??? Or if there id any other sugestion.


thanks.