我这是一个列表框的读取方式。javascript赋值
function submit_fun()
{
for(var i=0;i<document.form1.D1.length;i++)
{
document.form1.abc.value=document.form1.abc.value+document.form1.D1.options[i].value+"_";
}
document.form1.submit();
}另一页面读出来
if(request.getParameter("abc")!=null)
  {
    String abc = request.getParameter("abc");
 String[] paixu = abc.split("_");
 for(int i=0;i<paixu.length-1;i++)
 {
对取得的值进行操作
  }
  }

解决方案 »

  1.   

    这是后来写的一段代码<html>  
    <script>
    function set_c(theForm)  
     {  
      for(i=1;i<=4;i++)  
       {    
       obj=eval('theForm.x'+i);    
       if(obj.checked)    
       theForm.c.value+='x'+i+'@';   
       } 
     } 
    </script> 
    <body> 
    <%   if len(request("c"))>0 then response.write "you checked:" & request("c") & "<br>"  %>  
    <form method=post onsubmit=set_c(this)>  
       <input type=hidden name=c value=x0@>  
       <input type=checkbox name=x1>x1<br> 
       <input type=checkbox name=x2>x2<br>  
       <input type=checkbox name=x3>x3<br> 
       <input type=checkbox name=x4 >x4<br>  
       <input type=submit value=submit>  
    </form>  
    </body>
    </html>
      

  2.   

    老大,你写的是jsp代码吗,<% if len(request("c") 这些都是什么啊,我越看越象asp,你搞错了吧