select转移工具箱(8) arrValueTextRelation[arrSelValue[index]] = oSourceSel.options[i]; index ++; } } //增加缓存的数据到目的列表框中,并删除源列表框中的对应项 for(var i=0; i<arrSelText.length; i++) { //增加 var oOption = document.createElement("option"); oOption.text = arrSelText[i]; oOption.value = arrSelValue[i]; oTargetSel.add(oOption); //删除源列表框中的对应项 oSourceSel.removeChild(arrValueTextRelation[arrSelValue[i]]); }}
/** * added by LxcJie 2004.6.23 * 移动select的整块内容 * * oSourceSel: 源列表框对象 * oTargetSel: 目的列表框对象 */function moveAll(oSourceSel,oTargetSel){ //建立存储value和text的缓存数组 var arrSelValue = new Array(); var arrSelText = new Array(); //存储所有源列表框数据到缓存数组 for(var i=0; i<oSourceSel.options.length; i++) { arrSelValue[i] = oSourceSel.options[i].value; arrSelText[i] = oSourceSel.options[i].text; } //将缓存数组的数据增加到目的select中 for(var i=0; i<arrSelText.length; i++) { var oOption = document.createElement("option");