不好意思:代码贴得有点乱,整理一下:<logic:iterate id="userlist" name="users" >
<tr>
   <td width="5%"  align="center" class="font9title" height="11">
      <html:multibox name="userlist" property="isChecked" value="yes">
 <bean:write name="userlist" />
      </html:multibox>
   </td>
   <td width="11%"  align="center" height="11">
      <a href="/goToUpdateForm.do?userid=
         <bean:write name='userlist'property='userid'/>&dispatch=goToUpdateForm">
          <bean:write name="userlist" property="name"/>
      </a>
    </td>
    <td  align="left">
       <bean:write name="userlist" property="describe"/>
    </td>
    </tr>
 </logic:iterate>

解决方案 »

  1.   

    function selectAll(){if(document.all.selectAll.checked) 
      {
       for(i=0;i<document.all.userlist.length;i++)
          document.all.userlist[i].checked=false;
       }
    else
       {
       for(i=0;i<document.all.userlist.length;i++)
          document.all.userlist[i].checked=true;
       }}
      

  2.   

    to:timtin0361(全力以赴我们心中的梦)我的users 是一个在ActionBean 中保存的List:
    List users = service.viewUsers(userForm.getMap());
    request.setAttribute("users", users);所以在jsp中好像:document.all.userlist.length不对啊怎么办?
      

  3.   

    1、我想通过第一行中的checkbox来控制其它所有的checkbox,只要前者选定了,其余的就都选定,取消就都取消,我想用javascript写在selectAll()中处理,但不知怎么写;
    -----------------------
    document.form1.checkbox[0].checked=true;
    此时还要判断checkbox是0个、1个或是多个。
    自己研究一下2、如果任意选定了若干条记录以后,我如何能得到所选中的信息,我指的是如何判断那些是已经选中了的,以便后面的处理(如删除记录等)
    ------------------------
    可以在formbean中将属性定义为数组,struts会自动将相同属性名的checkbox的值放入数组。
    另外好像可以用request.getParameterValues()来获得对应参数的数组。