Two dropdown fields are present: DropDownA and DropDownB, along with a checkbox.
When the checkbox is checked, DropDownA will mirror the text, value, and selected index of DropDownB before becoming disabled.
The issue at hand:
Although the attributes can be changed successfully, there seems to be an issue with refreshing DropDownA on the screen. Even though the text attribute changes as indicated by an alert message, the visible text remains unchanged.
var x=document.getElementById("nazione_pr").selectedIndex;
var y=document.getElementById("nazione_pr").options;
var w=document.getElementById("nazione_spedizione").selectedIndex;
var z=document.getElementById("nazione_spedizione").options;
alert (y[x].text);
alert (z[w].text);
//w=x;
document.getElementById("nazione_spedizione").selectedIndex = document.getElementById("nazione_pr").selectedIndex;
z[w].text=y[x].text;
alert (z[w].text);
document.getElementById("nazione_spedizione").disabled=true;
$("nazione_spedizione").trigger("liszt:updated");
There seems to be a need for some sort of method to reload the select UI element.