给你一个能用的,自己改改吧
<body>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function compareOptionValues(a, b)
{
var sA = parseInt( a.value, 36 );
var sB = parseInt( b.value, 36 );
return sA - sB;
}
function compareOptionText(a, b)
{
var sA = parseInt( a.text, 36 );
var sB = parseInt( b.text, 36 );
return sA - sB;
}
function moveDualList( srcList, destList, moveAll )
{
if ( ( srcList.selectedIndex == -1 ) && ( moveAll == false ) )
{
return;
}
newDestList = new Array( destList.options.length );
var len = 0;
for( len = 0; len < destList.options.length; len++ )
{
if ( destList.options[ len ] != null )
{
newDestList[ len ] = new Option( destList.options[ len ].text, destList.options[ len ].value, destList.options[ len ].defaultSelected, destList.options[ len ].selected );
}
}
for( var i = 0; i < srcList.options.length; i++ )
{
if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )
{
newDestList[ len ] = new Option( srcList.options[i].text, srcList.options[i].value, srcList.options[i].defaultSelected, srcList.options[i].selected );
len++;
}
}
newDestList.sort( compareOptionValues ); // BY VALUES
for ( var j = 0; j < newDestList.length; j++ )
{
if ( newDestList[ j ] != null )
{
destList.options[ j ] = newDestList[ j ];
}
}
for( var i = srcList.options.length - 1; i >= 0; i-- )
{
if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )
{
srcList.options[i] = null;
}
}
}
// End -->
</script>
<form ACTION="" METHOD="POST" name="myForm">
<table border="0">
<tr>
<td>
<select multiple size="5" style="width:50" name="listLeft">
<option value="10">10</option>
<option value="20">20</option>
<option value="X" >X</option>
</select>
</td>
<td>
<NOBR>
<input type="button" style="width:90" onclick="moveDualList(this.form.listLeft,this.form.listRight, false )"
name="Add>>" value="Add>>"><BR>
<NOBR>
<input type="button" style="width:90" onclick="moveDualList( this.form.listRight, this.form.listLeft, false )"
name="Add<<" value="Add<<"><BR>
<NOBR>
<input type="button" style="width:90" onclick="moveDualList( this.form.listLeft, this.form.listRight, true )"
name="Add All>>" value="Add All>>"><BR>
<NOBR>
<input type="button" style="width:90" onclick="moveDualList( this.form.listRight, this.form.listLeft, true )"
name="Add All <<" value="Add All<<"><BR>
</NOBR>
</td>
<td>
<select multiple size="5" style="width:50" name="listRight">
<option value="01">1</option>
<option value="02">2</option>
<option value="03">3</option>
<option value="04">4</option>
</select>
</td>
</tr>
</table>
</form>
<body>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function compareOptionValues(a, b)
{
var sA = parseInt( a.value, 36 );
var sB = parseInt( b.value, 36 );
return sA - sB;
}
function compareOptionText(a, b)
{
var sA = parseInt( a.text, 36 );
var sB = parseInt( b.text, 36 );
return sA - sB;
}
function moveDualList( srcList, destList, moveAll )
{
if ( ( srcList.selectedIndex == -1 ) && ( moveAll == false ) )
{
return;
}
newDestList = new Array( destList.options.length );
var len = 0;
for( len = 0; len < destList.options.length; len++ )
{
if ( destList.options[ len ] != null )
{
newDestList[ len ] = new Option( destList.options[ len ].text, destList.options[ len ].value, destList.options[ len ].defaultSelected, destList.options[ len ].selected );
}
}
for( var i = 0; i < srcList.options.length; i++ )
{
if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )
{
newDestList[ len ] = new Option( srcList.options[i].text, srcList.options[i].value, srcList.options[i].defaultSelected, srcList.options[i].selected );
len++;
}
}
newDestList.sort( compareOptionValues ); // BY VALUES
for ( var j = 0; j < newDestList.length; j++ )
{
if ( newDestList[ j ] != null )
{
destList.options[ j ] = newDestList[ j ];
}
}
for( var i = srcList.options.length - 1; i >= 0; i-- )
{
if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )
{
srcList.options[i] = null;
}
}
}
// End -->
</script>
<form ACTION="" METHOD="POST" name="myForm">
<table border="0">
<tr>
<td>
<select multiple size="5" style="width:50" name="listLeft">
<option value="10">10</option>
<option value="20">20</option>
<option value="X" >X</option>
</select>
</td>
<td>
<NOBR>
<input type="button" style="width:90" onclick="moveDualList(this.form.listLeft,this.form.listRight, false )"
name="Add>>" value="Add>>"><BR>
<NOBR>
<input type="button" style="width:90" onclick="moveDualList( this.form.listRight, this.form.listLeft, false )"
name="Add<<" value="Add<<"><BR>
<NOBR>
<input type="button" style="width:90" onclick="moveDualList( this.form.listLeft, this.form.listRight, true )"
name="Add All>>" value="Add All>>"><BR>
<NOBR>
<input type="button" style="width:90" onclick="moveDualList( this.form.listRight, this.form.listLeft, true )"
name="Add All <<" value="Add All<<"><BR>
</NOBR>
</td>
<td>
<select multiple size="5" style="width:50" name="listRight">
<option value="01">1</option>
<option value="02">2</option>
<option value="03">3</option>
<option value="04">4</option>
</select>
</td>
</tr>
</table>
</form>
你用一个隐藏的文本框,用来存储结果
当你每天加一个的时候,就给文本框加值,比如A,B,C,用逗号隔开
然后,提交这个文本框,在那边接收,然后切分就行了
<tr><td>
<select name=list1 id=list1 size=8 ondblclick="moveOption(this, this.form.list2)">
<option value=A>aaaaaaaaaa
<option value=B>bbbbbbbbbb
<option value=C>cccccccccc
<option value=D>dddddddddd
<option value=E>eeeeeeeeee
<option value=F>ffffffffff
<option value=G>gggggggggg
<option value=H>hhhhhhhhhh
</select></td>
<td width=40 align=center>
<input name=add type=button value=">>>" onclick="moveOption(this.form.list1, this.form.list2)"><br><br>
<input name=sub type=button value="<<<" onclick="moveOption(this.form.list2, this.form.list1)">
</td><td>
<select name=list2 multiple id=list2 size=8 ondblclick="moveOption(this, this.form.list1)">
</select><br><input type=button value="select all" onclick="selectAll(this.form.list2)">
</td></tr></form>
</table><script language="JavaScript"><!--
function moveOption(e1, e2){
try{
var e = e1.options[e1.selectedIndex];
e2.options.add(new Option(e.text, e.value));
e1.options.remove(e1.selectedIndex);
} catch(e){}
}
function selectAll(select)
{
select.multiple = true;
for(var i=0; i<select.options.length; i++)
{
select.options[i].selected = true;
}
}
//--></script>
按ctrl就可以多选