为什么会出现这个错误,只能填加一个不能删除
<html>
<head>
<SCRIPT language="javascript">
function commuser()
{
var userf=document.userform;
userf.action="/prg/wm/DocAdd.jsp";
userf.submit();
}
function returnemp(inemp)
{
alert("hello one");
var day = inemp;
var month = (document.userappr.month.selectedIndex)+1;
var year = document.calControl.year.value;
if (day != " ") {
dateField.value = year + "-" + month + "-" + day;
window.close()
}
}
function LinkedDropList(oSelA,oSelB){
var dropList1 = oSelA
var dropList2 = oSelB
var autoRemove = true
var ignoreRepeat = false
//+-------------------------------------------------
//this.setAutoRemove=function(bStatus){
// autoRemove = ("boolean" == typeof(bStatus) ? bStatus : false)
//}
autoRemove =true;
//+--------------------------------------------------
//this.setIgnoreRepeat=function(bStatus){
// ignoreRepeat = ("boolean" == typeof(bStatus) ? bStatus : false)
//}
//+--------------------------------------------------
this.move=function(sDirection,nIndex){
if(sDirection=='forward'){
moveForward(nIndex)
}
else{
moveBack(nIndex)
}
}
this.moveAll=function(sDirection){
var oSrc,nTotal
if(sDirection=='forward'){
nTotal=dropList1.length
}
else{
nTotal=dropList2.length
}
for(var i = 0;i < nTotal;i ++){
if (!autoRemove){
this.move(sDirection,i)
}
else{
this.move(sDirection,0)
}
}
}
//+-------------------------------------------------
function moveBack(nIndex){
move(dropList2,dropList1,nIndex)
}
//+-------------------------------------------------
function moveForward(nIndex){
move(dropList1,dropList2,nIndex)
}
//+--------------------------------------------------
function move(oSrc,oTagert,nIndex){
var oCurOption
if(typeof(nIndex)=="undefined"){
if (-1 == oSrc.selectedIndex)
return
oCurOption=oSrc.options[oSrc.selectedIndex]
}
else{
oCurOption=oSrc.options[nIndex]
}
//check if it has added
if (!ignoreRepeat){
for(var i=0;i<oTagert.length;i++){
if(oCurOption.value == oTagert.options[i].value){
alert(oTagert.options[i].value)
oTagert.options[i].selected=true
return
}
}
}
//move element
oTagert.appendChild(oCurOption.cloneNode(true))
if(autoRemove){
oSrc.removeChild(oCurOption)
}
}
dropList1.ondblclick = moveForward
dropList2.ondblclick = moveBack
}
var ld
function window.onload(){
ld = new LinkedDropList(userappr.selsour,userappr.selde)
}
</SCRIPT>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="userappr" method="post" >
<table width="100%" border="1" bgcolor="#CCCCCC" height="100%">
<tr>
<td colspan="3">xxx</td>
</tr>
<tr>
<td width="41%">待选人员:</td>
<td rowspan="2" width="10%">
<input type="button" name="useradd" value="添加 ->" onclick="ld.move('forward')">
<input type="button" name="userdel" value="<- 删除" onclick="ld.move('back')">
<input type="button" name="alladd" value="全加 >>" onclick="ld.moveAll('forward')">
<input type="button" name="userreset" value="<< 重置" onclick="ld.moveAll('back')">
</td>
<td width="49%">已选人员:</td>
</tr>
<tr>
<td width="41%">
<select id="selsour" name="selsour1" size="10" style ="width:120">
<option>hello</option>
<option>daniel</option>
<option>joseph</option>
<%
%>
</select>
</td>
<td width="49%">
<select id="selde" name="selde" size="10" style ="width:120">
</select>
</td>
</tr>
<tr>
<td colspan="3">机构:
<select name="dropBranch" onChange="javascript:submit()">
<option></option>
</select>
部门:
<select name="select3">
</select>
<input type="button" name="Submit" value="确定" style="background-color: #DADFD0; border: 1 solid #A0AE88" class="btn" onClick="javascript:commuser()">
<input type="reset" name="Submit2" value="取消" style="background-color: #DADFD0; border: 1 solid #A0AE88" class="btn" onClick="javascript:window.close()">
</td>
</tr>
</table>
</form>
</body>
</html>