[CODE]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Admin_AdminGroupUser</title>
<link href="Include/Default.Css" rel="stylesheet" type="text/css" />
<Script language="javascript1.2">
function LeftToRight(frm,from,to){
simpleCopy(frm,from,to);
removeOptions(frm,from);
}
function RightToLeft(frm,from,to){
simpleCopy(frm,from,to);
removeOptions(frm,from);
}
function AllToRight(frm,from,to){
CopyAll(frm,from);
simpleCopy(frm,from,to);
removeOptions(frm,from);
}
function AllToLeft(frm,from,to){
CopyAll(frm,from);
simpleCopy(frm,from,to);
removeOptions(frm,from);
}
function simpleCopy(frm,from,to){
var objFrom = getFormElement(frm,from);
var objTo = getFormElement(frm,to);
if(objFrom.selectedIndex == -1){
return;
}
var index;
var notice = '';
for(var i = 0;i < objFrom.options.length;i ++) {
if(objFrom.options[i].selected) {
if(optionExists(objTo,objFrom.options[i])) {
continue;
}
index = objTo.options.length;
objTo.options[index] = new Option(objFrom.options[i].text,objFrom.options[i].value);
}
}
}
function CopyAll(from,left,right){
var objFrom = getFormElement(from,left);
for(var i = 0;i < objFrom.options.length;i ++) {
objFrom.options[i].selected = true;
}
}
function removeOptions(frm,selectbox) {
var obj = getFormElement(frm,selectbox);
var leftBracket = '【';
for(var i = obj.options.length -1;i >= 0;i --) {
var o = obj.options[i];
if(!o.selected || o.text.substr(0,1) == leftBracket)
continue;
obj.options[i] = null;
}
var maxIndex = obj.options.length - 1;
while(maxIndex >= 0 && obj.options[maxIndex].text.substr(0,1) == leftBracket) {
obj.options[maxIndex] = null;
maxIndex --;
}
flag = false;
for(i = obj.options.length - 1;i >= 0;i --) {
if(obj.options[i].text.substr(0,1) != leftBracket) {
flag = false;
} else {
if(flag == true) {
obj.options[i] = null;
}
flag = true;
}
}
obj.selectedIndex = -1;
}
function optionExists(selectbox,option) {
for(var i = 0;i < selectbox.options.length;i ++) {
if(selectbox.options[i].value == option.value) {
return true;
}
}
return false;
}
function getFormElement(frm,name) {
for(var i = 0;i < frm.elements.length;i ++) {
if(frm.elements[i].name == name)
return frm.elements[i];
}
}
</Script>
<SCRIPT language=JavaScript>
function DataFormSub(){
for(i=0;i<document.DataForm.AlreadyUser.options.length;i++){
if(document.DataForm.AlreadyUser.options[i].value!="")
document.DataForm.ChangeData.value += "|" + document.DataForm.AlreadyUser.options[i].value;
}
}
</SCRIPT>
</head>
<body scroll="yes">
<table width="100%" border="0" cellspacing="6" cellpadding="0">
<tr>
<td>
<form method="post" name="DataForm" action="Admin_AdminGroupAction.Asp?FunId=6&action=user" onSubmit="DataFormSub();">
<input type="hidden" name="ChangeData" value="">
<input type="hidden" name="ChangeGroupId" value="1">
<table width="100%" border="0" cellpadding="2" cellspacing="1" class="TabBody">
<tr id="TitleTr">
<td height="26" colspan="3" align="center">== <B>组用户管理</B> ==</td>
</tr>
<tr class="TableM_2">
<td width="40%" align="right">
<table width="80%" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td height="26" align="center">未分配用户</td>
</tr>
<tr>
<td class="TabBody">
<select name="NotUser" size="25" multiple style="width:100%" onDblClick="LeftToRight(this.form,'NotUser','AlreadyUser')">
<option value="test">测试用户</option>
<option value="administrator">超级管理员</option>
<option value="admin">系统管理员</option>
</select>
</td>
</tr>
</table>
</td>
<td width="20%" align="center"><table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td height="35" align="center"><input name="Submit1" type="button" class="Botton_2" value=">" onClick="LeftToRight(this.form,'NotUser','AlreadyUser')"></td>
</tr>
<tr>
<td height="35" align="center"><input name="Submit2" type="button" class="Botton_2" value="<" onClick="RightToLeft(this.form,'AlreadyUser','NotUser')"></td>
</tr>
<tr>
<td height="35" align="center"><input name="Submit3" type="button" class="Botton_2" value=">>" onClick="AllToRight(this.form,'NotUser','AlreadyUser')"></td>
</tr>
<tr>
<td height="35" align="center"><input name="Submit4" type="button" class="Botton_2" value="<<" onClick="AllToLeft(this.form,'AlreadyUser','NotUser')"></td>
</tr>
</table></td>
<td width="40%">
<table width="80%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="26" align="center">已分配用户</td>
</tr>
<tr>
<td class="TabBody">
<select name="AlreadyUser" size="25" multiple style="width:100%" onDblClick="RightToLeft(this.form,'AlreadyUser','NotUser')">
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr id="BtnTr">
<td height="26" colspan="3" align="center" class="TableBom"><table width="25%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><input name="Submit5" type="submit" class="Botton_3" value=" 提 交 "></td>
<td align="center"><input name="Submit6" type="button" class="Botton_3" onClick="history.back();" value=" 返 回 "></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>[/CODE]
是这样的效果吗?