是不是这个效果啊:<script>
//选择全部
var k=0;function  btnForward_onclick(){
var   theIndex=window.form1.selSubmit.selectedIndex;;
var   FirIndex=theIndex-1;
var   lenghtSel=window.form1.selSubmit.length;
    
if(lenghtSel!=0){
if(theIndex<0){
alert("请您先选择一个要移动的栏目...");
}else{
  if(theIndex==0){
alert("已经是最前面了...")
}else{
  
  var valF=window.form1.all("selSubmit")(FirIndex).value;        //前一个option的值
  var valT=window.form1.all("selSubmit")(theIndex).value;        //当前option的值
  
  var innerTextF=window.form1.all("selSubmit")(FirIndex).innerText;  //前一个option的显示内容
  var innerTextT=window.form1.all("selSubmit")(theIndex).innerText;  //当前option的显示内容

  window.form1.all("selSubmit")(theIndex).innerText=innerTextF;   //改变显示顺序
      window.form1.all("selSubmit")(FirIndex).innerText=innerTextT;   window.form1.all("selSubmit")(theIndex).value=valF;   //改变select的值
      window.form1.all("selSubmit")(FirIndex).value=valT;   window.form1.selSubmit.selectedIndex=FirIndex   
     }
}
}else{
alert("没有可前移的视图项目,请新增一个...");
}
}
function  btnBackward_onclick(){ var   theIndex=window.form1.selSubmit.selectedIndex;
var   maxIndex=document.all("selSubmit").length-1; 
var   lenghtSel=window.form1.selSubmit.length;
var   LstIndex=theIndex+1;
  
  if(lenghtSel!=0){
  
if(theIndex<0){
alert("请您先选择一个要移动的栏目...");
}else{
  if(theIndex==maxIndex){
alert("已经是最后面了...")
}else{

  var valL=window.form1.all("selSubmit")(LstIndex).value;   //后一个option的值
  var valT=window.form1.all("selSubmit")(theIndex).value;    //当前option的值
  
  var innerTextL=window.form1.all("selSubmit")(LstIndex).innerText;   //后一个option的显示内容
  var innerTextT=window.form1.all("selSubmit")(theIndex).innerText;   //当前option的显示内容

  window.form1.all("selSubmit")(LstIndex).innerText=innerTextT;   //改变显示顺序
  window.form1.all("selSubmit")(theIndex).innerText=innerTextL;
  
  window.form1.all("selSubmit")(LstIndex).value=valT;      //改变select的值
  window.form1.all("selSubmit")(theIndex).value=valL;

  window.form1.selSubmit.selectedIndex=LstIndex   
     }
}
}else{
alert("没有可后移的视图项目,请新增一个...");
}
}
//选择全部
function addAll(srcSel,objSel) {
    var  inti
    var  length1=eval("window.form1."+srcSel+".length")-1;
var  tempString
var  tempValue

for(inti=0;inti<=length1;inti++){
     
     window.form1.all(srcSel)(inti).selected=true;
     
var  objOpt=document.createElement("option");
    
         tempString=window.form1.all(srcSel)(inti).innerText;
         tempValue=window.form1.all(srcSel)(inti).value;         objOpt.text=tempString;
         objOpt.value=tempValue;

         eval("form1."+objSel+".add(objOpt)");   
}

for(inti=0;inti<=length1;inti++){  eval("form1."+srcSel+".remove(objOpt)");
}
}//删除全部
function delAll(srcSel,objSel) {
    var  inti
    var  length1=eval("window.form1."+objSel+".length")-1;
var  tempString
var  tempValue

for(inti=0;inti<=length1;inti++){

 window.form1.all(objSel)(inti).selected=true;

var  objOpt=document.createElement("option");      tempString=window.form1.all(objSel)(inti).innerText;
         tempValue=window.form1.all(objSel)(inti).value;
         
     if(objSel!="selSubmit")
 {     
  removeSign(tempString,tempValue); //调用vb子程序进行字符处理

tempString=form1.hid_String1.value; //重新赋值
tempValue=form1.hid_String2.value;
 }

         objOpt.text=tempString;
         objOpt.value=tempValue;         eval("form1."+srcSel+".add(objOpt)");   
    }

for(inti=0;inti<=length1;inti++){
 
eval("form1."+objSel+".remove(objOpt)");
}

k=0;
}//删除一条记录
function delOne(srcSel,objSel){    var  inti
    var  length1=eval("window.form1."+objSel+".length")-1;
var  tempString
var  tempValue

         inti=eval("window.form1."+objSel+".selectedIndex");
 
 if(length1>=0){
 
if(inti>=0){ var  objOpt=document.createElement("option");     tempString=window.form1.all(objSel)(inti).innerText;
        tempValue=window.form1.all(objSel)(inti).value;

 if(objSel!="selSubmit")         
 { 
removeSign(tempString,tempValue); //调用vb子程序进行字符处理

tempString=form1.hid_String1.value; //重新赋值
tempValue=form1.hid_String2.value;
 }
 
        objOpt.text=tempString;
        objOpt.value=tempValue;         eval("form1."+srcSel+".add(objOpt)");
        eval("form1."+objSel+".remove(inti)");
   
        if(k==5){
k=k-2; 
        }else{
k=k-1;
        }
 }else{
    alert("请您先选择要移除的栏目...")
 }
  }else{
 alert("没有可移除的栏目...");
  }    
}//新增一条记录function addOne(srcSel,objSel) {    var  inti
    var  length1=eval("window.form1."+srcSel+".length")-1;
var  tempString
var  tempValue

         inti=eval("window.form1."+srcSel+".selectedIndex");
  
  if(length1>=0){
  
if(inti>=0){ 
           
var  objOpt=document.createElement("option");     tempString=window.form1.all(srcSel)(inti).innerText;
        tempValue=window.form1.all(srcSel)(inti).value;

        objOpt.text=tempString;
        objOpt.value=tempValue;
        
        eval("form1."+objSel+".add(objOpt)"); //新增一个option   
        eval("form1."+srcSel+".remove(inti)"); //移除原有的option
  
  }else{
 alert("请您先选择要增加的栏目...");
  }       
   }else{
   alert("没有可增加的栏目..."); 
   }    
}
//新增一条记录
function addOneSort(srcSel,objSel,intj,type) {

k=k+1;

    var  inti
    var  length1=eval("window.form1."+srcSel+".length")-1;
var  tempString
var  tempValue

         inti=eval("window.form1."+srcSel+".selectedIndex");
  
  if(length1>=0){
  
if(inti>=0){ 
if(k<=intj){            
var  objOpt=document.createElement("option");     tempString=window.form1.all(srcSel)(inti).innerText;
     tempValue=window.form1.all(srcSel)(inti).value; if(type=="down"){
     objOpt.text=tempString.replace(/\s+$/,"")+"↓";
     objOpt.value=tempValue.replace(/\s+$/,"")+"↓";
}else{
     objOpt.text=tempString.replace(/\s+$/,"")+"↑";
     objOpt.value=tempValue.replace(/\s+$/,"")+"↑";
}

     eval("form1."+objSel+".add(objOpt)");
     eval("form1."+srcSel+".remove(inti)");

}else{
 alert("对不起,您只能对"+intj+"个栏目进行排序");
}
  }else{
 alert("请您先选择要排序的栏目...");
 k=0;
  }       
   }else{
   alert("没有可排序的栏目...");
   k=0 
   }    
}</script>(待续)

解决方案 »

  1.   

    TO andrawu  我做了一个JSP页,如何得到被选择项目的内容.
      

  2.   

    在form1中增加一个隐藏的元素hidVar,用来保存你被选择项目的内容,被选择项目的内容之间用“*”分隔。你就可以在jsp页面中用
    request.getParameter("hidVar") ;取到后,再分离。<input type="button" value="test" onclick="test();"> 
    <input type="hidden" name="hidVar"><script>
    function test(){
    var sTemp = "" ;
    var oform = document.form1 ;
    for (var i=0;i<oform.selSubmit.length;i++){
    sTemp += "*"+oform.selSubmit.options[i].value;
    }
    oform.hidVar.value = sTemp.substring(1) ;
    alert(oform.hidVar.value) ;
    }</script>