1 得到Request.getParameter("selectname")。然后截取字符串,以","作为分隔符。变可得到选择的各个值

解决方案 »

  1.   

    <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("没有可增加的栏目..."); 
       }    
    }
      

  2.   

    1、
    String s[] = request.getParameterValues("selectname")
    2、楼上的就可以了。
      

  3.   

    String s[] = request.getParameterValues("selectname") ;
      

  4.   

    这位虚竹老兄/弟,我在javascript中也发了同样的贴子,您不嫌弃就去谢点儿东西,把分一起给您得了。