а

Dynamical select value of combo populated from combo_connector.php


#1

Hi,
I have a form populated from a XML loading the combo data from a database via combo_connector

I can’t figure out how to set the selected value


#2

add onXLE event to combo and then select option:

myCombo.attachEvent('onXLE', function() {
      myCombo.selectOption(optionIndex);
}

#3

Hi klysial,

thanks for the answer. I’m not sure to understand. the object “myCombo” isn’t create in javascript but in xml so I dont see how to attach the event without the combo name

item type=“combo” label=“Corps de métier” connector="…/views/metier/combo.php" name=“corps_de_metier” offsetLeft=“15”/


#4

Do the following.
myCombo = formObject.getCombo(‘corps_de_metier’);
and then you can use the above