My function below is not working properly.
I have two select boxes which have the same option list.
When user selected the option for box 1, the same option will be removed from box 2 — this part is working fine.
However, if the user changes the original option to another option in box 1 , I would like the option list of box 2 to “include back” the original option and with the another option removed from the list — this is the part that is not working.
function Operator2List() {
var Op1=document.getElementById(“x_P_By_Operator1”);
var Op2=document.getElementById(“x_P_By_Operator2”);
if (Op1.length!=Op2.length) {
document.getElementById(“x_P_By_Operator2”).value = document.getElementById(“x_P_By_Operator1”).options;
}
Op2.remove(Op1.selectedIndex);
Any suggestion? Thank you very much!