I think you need something like this:
dojo.connect(s1, 'onChange', function(value) {
console.log(value);
s2.addOption([{
label: "new option1", value: 1
},
{
label: "new option2", value: 2
},
{
label: "new option3", value: 3
}]);
});
In this example above, when the selected value of s1 changes, we load 3 new parameters into s2. You can only pass one option to the addOption method instead of an array:
s2.addOption({ label: "new option1", value: 1 }
You might also want to clear s2 first:
s2.options = [];
source
share