就跟CSDN这里的结贴一样,需要给多个用户分数,然后提交,我想知道后台那边要怎么接收这批数据?比如说我一个页面里有一个用户列表,然后后面的action只定义了一个User和List<User>的对象
如果我要实现删除多个用户,先把要删除的用户打上checkbox,然后提交,action那里要怎么接收?

解决方案 »

  1.   

     var str='';
           for(var i=0;i<document.forms[0].elements.length;i++){
            
           if(document.forms[0].elements[i].type== "checkbox") 
             {    
                  if(document.forms[0].elements[i].checked){
                      alert(document.forms[0].elements[i].value);
                      str=str+document.forms[0].elements[i].value+'/';
                     // alert(str);
                 }
    我在页面上先来几个checkbox,然后将选中的值拿到,连接成一个字符串传到后台,后台action中 String str=request.getParatemer("str");然后解析这个字符串就可以了 
           }<th>
    是否全省通用
    </th>
    <td>
    <html:select property="resInfo.IS_PRO" styleId="is_pro"
    onchange="change_pro()">
    <option value="Y">

    </option>
    <option value="N">

    </option>
    </html:select>
    </td>
    </tr>
    <tr id="regionid" style="display: none"> <th>
    选择地市:
    </th>
    <td colspan="5"> <%
    List list = (List) request.getAttribute("regionlist");
    String a[] = null;
    int len = list.size();
    for (int i = 0; i < len; i++) {
    a = (String[]) list.get(i);
    %> <input type="checkbox" name="kk" value="<%=a[0]%>"><%=a[1]%> <%
    }
    %> </td>
    </tr>