<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD><BODY>
<select name=ss size=10>
 <option value="1">&Eacute;ú&sup2;ú&sup3;§&frac14;&Ograve;</option>
 <option value="2">×&Uuml;&acute;ú&Agrave;í</option>
 <option value="3">&Ccedil;&oslash;&Oacute;ò&acute;ú&Agrave;í</option>
 <option value="4">&frac34;&shy;&Iuml;ú&Eacute;&Igrave;</option>
 <option value="5">ר&Ograve;&micro;&sup1;¤&sup3;&Igrave;&Eacute;&Igrave;</option>
</select><input type=button name=btnUp value=up onclick="s(-1)">
<input type=button name=btnDown value=down onclick="s(1)">
<script language="JavaScript">
<!--
function s(flag)
{
  if (ss.selectedIndex != -1 && ss.selectedIndex+flag >=0 && ss.selectedIndex+flag < ss.length)
  {
    var v = ss.options[ss.selectedIndex+flag].value;
    var t = ss.options[ss.selectedIndex+flag].text;
 
    ss.options[ss.selectedIndex+flag].value = ss.options[ss.selectedIndex].value; 
    ss.options[ss.selectedIndex+flag].text = ss.options[ss.selectedIndex].text;     ss.options[ss.selectedIndex].value = v; 
    ss.options[ss.selectedIndex].text = t;     ss.selectedIndex += flag;
  }
}
//-->
</script>
</BODY>
</HTML>至于让asp得到排列顺序,可以把顺序组成一个字符串放到一个hidden字段中提交

解决方案 »

  1.   

    <body>
    <script language="JavaScript">
    <!--
    function move_self(s,flag){
    var sa=document.frm.elements[s]
    var tem;
    with(sa){
    if(flag==1){
    if(selectedIndex>0)
    for(i=0;i<length;i++)
    if(options[i].selected){
    tem_text=options[i].text;tem_value=options[i].value
    options[i].text=options[i-1].text;
    options[i].value=options[i-1].value;
    options[i-1].text=tem_text;options[i-1].value=tem_value
    options[i-1].selected=true;options[i].selected=false
    }
    }
    else
    for(i=length-1;i>=0;i--)
    if(options[i].selected){
    if(i==length-1)break;
    tem_text=options[i].text;tem_value=options[i].value
    options[i].text=options[i+1].text;
    options[i].value=options[i+1].value;
    options[i+1].text=tem_text;options[i+1].value=tem_value
    options[i+1].selected=true;options[i].selected=false
    }
    }
    }
    function show()
    {
    var  str=""
    for(var i=0;i<frm.ss.options.length;i++)
    str += "," + frm.ss.options[i].value;
    str = str.substr(1,str.length-1)
    frm.t1.value=str
    alert(str)
    }
    //-->
    </script>
    <form name="frm">
    <select name="ss" size="5" style="width:100" multiple>
     <option value="1">生产厂家</option>
     <option value="2">总代理</option>
     <option value="3">区域代理</option>
     <option value="4">经销商</option>
     <option value="5">专业工程商</option>
    </select>
      <br/>
    <input type=button value="up" onclick="move_self('ss',1)">
    <input type=button value="down" onclick="move_self('ss',-1)">
      <input type="button" name="Button" value="得到主次排列" onClick="show()">
      <input type="text" name="t1">
    </form>
    </body>
      

  2.   

    <title>移动、交换SELECT内容</title>
    <style type="text/css">
    <!--
    body { background-color:#CECECE;}
    button { font-family:"webdings";font-size:10px;width:17px;height:15px;line-height:4px;cloudchen:expression(hideFocus=true)}
    select { font-family:"Verdana";font-size:11px;}
    -->
    </style>
    <script>var createDate = "2003.8.23";</script>
    <script language="javascript" defer>
    //添加事件
    fromSel.attachEvent("ondblclick",new Function("MoveOptions(fromSel,toSel)"))
    toSel.attachEvent("ondblclick",new Function("MoveOptions(toSel,fromSel)"))
    LeftButton.attachEvent("onmouseup",new Function("MoveOptions(fromSel,toSel)"))
    RightButton.attachEvent("onmouseup",new Function("MoveOptions(toSel,fromSel)"))
    //移动函数
    function MoveOptions(fromObj,toObj) {
    for (var i=0;i<fromObj.length;i++) {
    if (fromObj.options[i].selected&&i!=0) {
    with(toObj)options[length] = new Option(fromObj.options[i].text,fromObj.options[i].value);
    with(fromObj)options[i] = null,i--;
    if (event.type=="dblclick") break;
    }
    }
    }
    //交换函数
    function SwapOptions(obj,direction) {
    var objIndex = obj.selectedIndex;
    var swapIndex=direction=="up"?objIndex-1:objIndex+1;
    if ((swapIndex==obj.length&&direction=="down")||(swapIndex==-1&&direction=="up")||obj.selectedIndex==0||swapIndex<=0) return false;
    obj.options[objIndex].swapNode(obj.options[swapIndex]);
    }
    </script>
    <body>
    <span style="width:165px;">
    <button onmouseup="SwapOptions(fromSel,'up')">5</button>
    <button onmouseup="SwapOptions(fromSel,'down')">6</button>
    <select id="fromSel" multiple size=10>
    <option>---请选择要进入的网站---
    <option>CSND.net
    <option>MSND.com
    <option>Blueidea.com
    <option>51job.com
    <option>Yahoo.com
    <option>Pchome.net
    <option>Sina.com.cn
    </select>
    <div align="center">
    <button id="RightButton">7</button>
    <button id="LeftButton">8</button>
    </div>
    <select id="toSel" multiple size=10>
    <option>---请选择感兴趣的网站---
    </select>
    <div align="right">
    <button onmouseup="SwapOptions(toSel,'up')">5</button>
    <button onmouseup="SwapOptions(toSel,'down')">6</button>
    </div>
    <SCRIPT LANGUAGE="JavaScript" SRC="createDate.js"></SCRIPT>
    </span><br>
    <SCRIPT LANGUAGE="JavaScript" SRC="list.js"></SCRIPT>
      

  3.   

    收集了两三个
    http://expert.csdn.net/Expert/topic/2142/2142148.xml?temp=.6045191