⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 selectreaduser.js

📁 办公自动化系统 适用于办公室的各种几本功能的操作 功能比较简单
💻 JS
字号:
function addConfirmer() {
    myform = document.userform;
    for (i = 0; i < myform.selectableIDList.options.length; i++) {
        if (myform.selectableIDList.options(i).selected == true) {
	    j = myform.selectedIDList.options.length - 1;
	    for (; j >= 0; j--) {
	 	if (myform.selectableIDList.item(i).value == myform.selectedIDList.item(j).value) {
	 	    break;
	 	}
	    }
	    if (j < 0) {
	        newOpt = new Option(myform.selectableIDList.item(i).text, myform.selectableIDList.item(i).value);
                myform.selectedIDList.add(newOpt);
	    }
	}
    }
}

function removeConfirmer() {
    myform = document.userform;

    myindex = 0;
    for (; myindex < myform.selectedIDList.options.length; myindex++) {
        if (myform.selectedIDList.options(myindex).value == myform.operatorID.value) {
            break;
	}
    }
    if (myindex == myform.selectedIDList.options.length) {
        myindex = -1;
    }

    for (i = myform.selectedIDList.options.length - 1; i > myindex; i--) {
        if (myform.selectedIDList.options(i).selected == true) {
            myform.selectedIDList.remove(i);
	}
    }
}

function moveUpDn(direction) {
    myform = document.userform;

    myindex = 0;
    for (; myindex < myform.selectedIDList.options.length; myindex++) {
    	var text = myform.selectedIDList.options(myindex).text;
    	if ( text.charAt(0) != '*'){
    		myindex--;
        //if (myform.selectedIDList.options(myindex).value == myform.operatorID.value) {
            break;
	}
    }
    
    if (myindex == myform.selectedIDList.options.length) {
        myindex = -1;
    }

    index = myform.selectedIDList.options.length;
    count = 0;
    for (i = myform.selectedIDList.options.length - 1; i > myindex; i--) {
        if (myform.selectedIDList.options(i).selected == true) {
	    count++;
	    index = i;
	}
    }
    if (count == 1) {	// Select One only
        if (direction < 0 && index > myindex + 1) {		// Up
	    newOpt = new Option(myform.selectedIDList.item(index).text, myform.selectedIDList.item(index).value);
	    newOpt.selected = true;
            myform.selectedIDList.remove(index);
            myform.selectedIDList.add(newOpt, index + direction);
        }
        if (direction > 0 && index < myform.selectedIDList.options.length - 1) { // Down
	    newOpt = new Option(myform.selectedIDList.item(index).text, myform.selectedIDList.item(index).value);
	    newOpt.selected = true;
            myform.selectedIDList.remove(index);
            myform.selectedIDList.add(newOpt, index + direction);
        }
    }
}


function GetUsers()
{
		myform = document.userform;
		myindex=0;
		for (i = myform.selectedIDList.options.length -1; i >= myindex; i--) {
        myform.selectedIDList.options(i).selected = true;
		myform.SelectedUsers.value=myform.SelectedUsers.value +','+ myform.selectedIDList.item(i).value
		}
}

function closewindow(selectusers,strSelectUsers){
	self.opener.document.UserForm.ToID.value=selectusers;
	self.opener.document.UserForm.ToName.value=strSelectUsers;
	self.close();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -