您好,欢迎访问一九零五行业门户网

移动到右边的,为什么要选中后提交才能获取到相应的值该怎么解决

移动到右边的,为什么要选中后提交才能获取到相应的值。
本帖最后由 qq914260102 于 2013-10-14 16:02:07 编辑 如果选到右边,是无法获取到值的,必须要点击一次,选中了才能获取到,怎么让右边的默认能获取值
item 1.1 
 item 1.2 
 item 1.3 
站长特效
>  onclick=move(this.form.list1,this.form.list2) name=b1>
item 2.1 
 item 2.2 
 item 2.3 
站长特效网
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 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;
}
}
分享到: