i am using chosen prototype.
i want to update second select box based on first select box. how to do this?
i can able to fire onchange event but i am not able to update the second select box based on onchange event in first select box.
<select class="chzn-select" id="one">
<option>one</option>
<option>two</option>
<option>three</option>
</select>
<select class="chzn-select" id="two">
</select>
$$('#one').each(function(select) {
new Chosen(select);
})
.invoke('observe', 'change', function() {
alert(document.getElementById("one").value);
//update the second select here
});
$$('#two').each(function(select) {
new Chosen(select);
})
.invoke('observe', 'change', function() {
alert(document.getElementById("two").value);
});
Here is example update code based on DOM: