var fromList=eval('document.forms[0].'+from);
var toList=eval('document.forms[0].'+to);
if(toList.options.length > 0 && toList.options[0].value == 'temp'){
toList.options.length=0;
}
var sel=false;
for(i = 0;i < fromList.options.length;i++){
var current=fromList.options[i];
if(current.selected){
sel=true;
if(current.value=='temp'){
alert('不能选择这个项目!');
return;
}
txt=current.text;
val=current.value;
toList.options[toList.length]=new Option(txt,val);
fromList.options[i]=null;
i--;
}
}
if(!sel) alert('你还没有选择任何项目!');
}
function allSelect(){
var chsen=document.getElementById('chosen');
//如果chsen列表框为0或第一个选项值为'temp'
if(chsen.length && chsen.options[0].value=="temp")
return;
for(var i=0;i
}
//得到数据
function getdata() {
var List = document.forms[0].RoleList;
//得到一个隐藏文本框对象
var roles = document.getElementById("TRoleList");
roles.value = "";
var s = "";
if (List.length != 0) {
for (i = 0; i < List.length; i++) {
s += List.options[i].value + ",";
}
}
roles.value = s;
}
}
script>