1,前台页面源文件
2,前台脚本
<script>
//移动选中项目
function MoveSingleItem(sel_source, sel_dest)
{
if (sel_source.selectedIndex<0)return; //源:没有点选任何项目
//for(var j=0; j<sel_dest.length; j++){
// if(sel_dest.options[j].value==sel_source.options[sel_source.selectedIndex].value)
// return;
//
}
var oOption = document.createElement("OPTION");
oOption.text=sel_source.options[sel_source.selectedIndex].text;
oOption.value=sel_source.options[sel_source.selectedIndex].value;
sel_dest.options.add(oOption);
sel_source.options.remove(sel_source.selectedIndex);
CopyToControl();
}
//设置选中项目
function MoveAllItems(sel_source, sel_dest)
{
var sel_source_len = sel_source.length;
//先复制“源”所有项目:
for (var j=0; j<sel_source_len; j++)
{
var oOption = document.createElement("OPTION");
oOption.text=sel_source.options[j].text;
oOption.value=sel_source.options[j].value;
sel_dest.options.add(oOption);
}
//然后删除“源”所有项目:
for (var k=0;k<sel_source_len;k++)
{
sel_source.options.remove(0);
}
CopyToControl();
}
function SelectAll(theSel) //选中select中全部项目
{
for (i = 0 ;i<theSel.length;i++)
theSel.options[i].selected = true;
}
function CopyToControl(){ //复制到其他控件
var sControl=document.all.txt_ObjectUser;
sControl.value="";
for(var i=0;i<document.all.Lb_Object.length;i++){ //拷贝数据
sControl.value=sControl.value+document.all.Lb_Object.options[i].value+',';
}
}
//页面加载
function On_PageLoad(){
if(PageLoadFlag)return;
PageLoadFlag=true;
var theSel=document.all["Ddl_Org"];
var re=/&/;
//替换字符串 www.jb200.com
if(theSel!=null){
for(i=0;i<theSel.length;i++){
do{
var sTem=theSel.options[i].innerHTML;
theSel.options[i].innerHTML = theSel.options[i].innerHTML.replace("&","&");
}while(sTem!=theSel.options[i].innerHTML)
}
}
}
</script>