Move to the right, why should you select Post to get the corresponding value.
This post was last edited by qq914260102 on 2013-10-14 16:02:07
If you choose to the right, you cannot get the value, you must click once, select to get to, how to let the right side of the default can get the value
Sortitems = 1; Automatically sort items within lists? (1 or 0)
function Move (Fbox,tbox) {
for (var i=0; i
if (fbox.options[i].selected && fbox.options[i].value! = "") {
var no = new Option ();
No.value = Fbox.options[i].value;
No.text = Fbox.options[i].text;
Tbox.options[tbox.options.length] = no;
Fbox.options[i].value = "";
Fbox.options[i].text = "";
}
}
Bumpup (Fbox);
if (sortitems) SortD (Tbox);
}
function Bumpup (box) {
for (var i=0; i
if (Box.options[i].value = = "") {
for (var j=i; j
Box.options[j].value = Box.options[j+1].value;
Box.options[j].text = Box.options[j+1].text;
}
var ln = i;
Break
}
}
if (ln < box.options.length) {
Box.options.length-= 1;
Bumpup (box);
}
}
function SortD (box) {
var temp_opts = new Array ();
var temp = new Object ();
for (var i=0; i
Temp_opts[i] = box.options[i];
}
for (var x=0; x
For (Var y= (x+1); y
if (Temp_opts[x].text > Temp_opts[y].text) {
temp = Temp_opts[x].text;
Temp_opts[x].text = Temp_opts[y].text;
Temp_opts[y].text = temp;
temp = Temp_opts[x].value;
Temp_opts[x].value = Temp_opts[y].value;
Temp_opts[y].value = temp;
}
}
}
for (var i=0; i
Box.options[i].value = Temp_opts[i].value;
Box.options[i].text = Temp_opts[i].text;
}
}
Share to:
------Solution--------------------
Don't bother to read code understanding, Pure Imagination
Form submission, select only submits the selected option
So if you want to commit list2, add all the selected attributes, or assign each value of option to a new control (such as hidden) to commit