Move to the right, why should you select Post to get the corresponding value. How to solve it

Source: Internet
Author: User
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
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.