本帖最后由 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
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
for(var j=i; j
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
}
for(var x=0; x
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].text = temp_opts[i].text;
}
}
分享到:
