PHP代码:--------------------------------------------------------------------------------脚本说明:把如下代码加入区域中<br /><!-- Begin<br />oldvalue = "";<br />function passText(passedvalue) {<br /> if (passedvalue != "") {<br /> var totalvalue = passedvalue+"\n"+oldvalue;<br /> document.displayform.itemsbox.value = totalvalue;<br /> oldvalue = document.displayform.itemsbox.value;<br /> }<br />}<br />// End --><br /> 请选择 第一项 第二项 第三项 第四项 第五项 第六项 你可以自己选择一下:PHP代码:--------------------------------------------------------------------------------脚本说明:把如下代码加入区域中<br /><!-- Begin<br />var delimiter = ":";<br />function MoveOption (MoveFrom, MoveTo, ToDo) {<br /> var SelectFrom = eval('document.main_form.'+MoveFrom);<br /> var SelectTo = eval('document.main_form.'+MoveTo);<br /> var SelectedIndex = SelectFrom.options.selectedIndex;<br /> var container;<br /> if (ToDo=='Add') {<br /> container=eval('document.main_form.'+ToDo+MoveTo);<br /> }<br /> if (ToDo=='Remove') {<br /> container=eval('document.main_form.'+ToDo+MoveFrom);<br /> }<br /> if (SelectedIndex == -1) {<br /> alert("请选择一个用户");<br /> } else {<br /> for (i=0; i<SelectFrom.options.length; i++) {<br /> if(SelectFrom.options[i].selected) {<br /> var name = SelectFrom.options[i].text;<br /> var ID = SelectFrom.options[i].value;<br /> SelectFrom.options[i] = null;<br /> SelectTo.options[SelectTo.options.length]=new Option (name,ID);<br /> i=i-1;<br /> if(ToDo=='Add'||ToDo=='Remove') {<br /> container.value=container.value+name+delimiter;<br /> //container.value=container.value+ID+delimiter;<br /> }<br /> }<br /> }<br /> }<br />}<br />function CheckDuplicates (AddListContainer, RemoveListContainer) {<br /> var AddList = eval('document.main_form.'+AddListContainer);<br /> var RemoveList = eval('document.main_form.'+RemoveListContainer);<br /> var TempAddList = AddList.value;<br /> var TempRemoveList = RemoveList.value;<br /> if (TempAddList>'&&TempRemoveList>') {<br /> TempAddList = TempAddList.substring(0,TempAddList.length-1);<br /> TempRemoveList = TempRemoveList.substring(0,TempRemoveList.length-1);<br /> var AddArray = TempAddList.split(delimiter);<br /> var RemoveArray = TempRemoveList.split(delimiter);<br /> for (i=0; i<AddArray.length; i++) {<br /> for (j=0; j<RemoveArray.length; j++) {<br /> if (AddArray[i]==RemoveArray[j]) {<br /> AddArray[i]=';<br /> RemoveArray[j]=';<br /> break;<br /> }<br /> }<br /> }<br /> AddList.value=';<br /> for (i=0; i<AddArray.length; i++) {<br /> if (AddArray[i]>') {<br /> AddList.value = AddList.value + AddArray[i] + delimiter;<br /> }<br /> }<br /> RemoveList.value=';<br /> for (i=0; i<RemoveArray.length; i++) {<br /> if (RemoveArray[i]>') {<br /> RemoveList.value = RemoveList.value + RemoveArray[i] + delimiter;<br /> }<br /> }<br /> }<br />}<br />function LockChanges() {<br /> CheckDuplicates('AddAdmins','RemoveAdmins');<br /> CheckDuplicates('AddUsers','RemoveUsers');<br />}<br />// End --><br /> type=hidden name=RemoveUsers> 备选用户Employee_01 Employee_02 Employee_03 Employee_04 Employee_05 Employee_06 Employee_07 Employee_08 Employee_09 Employee_10 AdministratorsAdmin_01 Admin_02 Admin_03 Admin_04 Admin_05 UsersUser_01 User_02 User_03 User_04 User_05 查询增加的Admin查询删除的Admin查询增加的User查询删除的User PHP代码:--------------------------------------------------------------------------------脚本说明:把如下代码加入区域中:<br /><br /><!-- Begin<br />sortitems = 1; // Automatically sort items within lists? (1 or 0)<br /><br />function move(fbox,tbox) {<br />for(var i=0; i<fbox.options.length; i++) {<br />if(fbox.options[i].selected && fbox.options[i].value != "") {<br />var no = new Option();<br />no.value = fbox.options[i].value;<br />no.text = fbox.options[i].text;<br />tbox.options[tbox.options.length] = no;<br />fbox.options[i].value = "";<br />fbox.options[i].text = "";<br /> }<br />}<br />BumpUp(fbox);<br />if (sortitems) SortD(tbox);<br />}<br />function BumpUp(box) {<br />for(var i=0; i<box.options.length; i++) {<br />if(box.options[i].value == "") {<br />for(var j=i; j<box.options.length-1; j++) {<br />box.options[j].value = box.options[j+1].value;<br />box.options[j].text = box.options[j+1].text;<br />}<br />var ln = i;<br />break;<br /> }<br />}<br />if(ln < box.options.length) {<br />box.options.length -= 1;<br />BumpUp(box);<br /> }<br />}<br /><br />function SortD(box) {<br />var temp_opts = new Array();<br />var temp = new Object();<br />for(var i=0; i<box.options.length; i++) {<br />temp_opts[i] = box.options[i];<br />}<br />for(var x=0; x<temp_opts.length-1; x++) {<br />for(var y=(x+1); y<temp_opts.length; y++) {<br />if(temp_opts[x].text > temp_opts[y].text) {<br />temp = temp_opts[x].text;<br />temp_opts[x].text = temp_opts[y].text;<br />temp_opts[y].text = temp;<br />temp = temp_opts[x].value;<br />temp_opts[x].value = temp_opts[y].value;<br />temp_opts[y].value = temp;<br /> }<br /> }<br />}<br />for(var i=0; i<box.options.length; i++) {<br />box.options[i].value = temp_opts[i].value;<br />box.options[i].text = temp_opts[i].text;<br /> }<br />}<br />// End --><br /> item 1.1 item 1.2 item 1.3 item 2.1 item 2.2 item 2.3