多项选择脚本
发表于:2006年10月26日 10时32分57秒本文链接:http://user.qzone.qq.com/183481361/blog/31

多项选择脚本
<script LANGUAGE="javascript">
function SelectOK()
{
if (trim(document.Form1.Bjbh.value) == "" )
{
alert("请先确定一个班级!");
document.Form1.Bjbh.focus();
return(false);
}
try{
var bjbhValue = "";
var bjbhName = "";
var bjbhList = document.all("Bjbh");
var bjbhListLen = bjbhList.options.length;
for (i=1;i<=8;i++)
{
if(bjbhList.options(i).selected){
bjbhValue = bjbhValue + bjbhList.options(i).value + ",";
bjbhName = bjbhName + bjbhList.options(i).text + ",";
}
}
bjbhValue = bjbhValue.substr(0,bjbhValue.length-1);
bjbhName = bjbhName.substr(0,bjbhName.length-1);
//alert(trim(bjbhValue));
//alert(trim(bjbhName));
window.opener.window.document.all(document.Form1.UpdateBH.value).value = trim(bjbhValue);
window.opener.window.document.all(document.Form1.UpdateXM.value).value = trim(bjbhName);
window.close();
}
catch(exception){
window.close();
}
}
</script>