<div id="dia-fjxz" title="可选择下载">
<s:form id="form_fjxz" name="form_fjxz" method="post" action="downloadMultiFile">
<table width="90%" border="1" id="table_fjxz" class="backColor">
<tbody>
                <tr>
                  <td width="10%" align="center"><input type="checkbox" name="all" id="all"/></td>
                  <td width="10%" align="center"><span class="STYLE4">序号</span></td>
                  <td width="40%" class="STYLE4" align="center">附件名称</td>
                  <td width="30%" class="STYLE4" align="center">附件大小</td>
                 </tr>
                 <s:iterator value="#request.zjjg.additions" var="addition" status="st6">              
                <tr>
                   <td width="10%" align="center">
                    <input type="checkbox" name="attachmentPath" id="attachmentPath" value="<s:property value="#addition.filepath"/>"/>
                    </td>
                 <td align='center' class="STYLE24"><s:property value="#st6.index+1" /></td>
                 <td align='center' class="STYLE24"><s:property value="#addition.name" /></td>
                 <td align='center' class="STYLE24"><s:property value="#addition.filesize" /></td>
              </tr>                          
             </s:iterator>
             </tbody>
              </table>
              <s:if test="">
              <input type=button value="下载 " id="button" style="width:50px;height:25px" />
              </s:if>
              <s:else>
              <input type=submit value="下载 " id="submit" style="width:50px;height:25px" />
              </s:else>
             
</s:form>
</div>   

解决方案 »

  1.   

    <s:if test="">
                                             <input type=button value="下载 " id="button" style="width:50px;height:25px" />
                                         </s:if>
                                         <s:else>
                                             <input type=submit value="下载 " id="submit" style="width:50px;height:25px" />
                                         </s:else>
     这段代码是可行的么 ? 如果可行的话 ,我想判断下迭代器里面的checkbox是否选定,这个test怎么写
      

  2.   

    判断是否选定,你用JS来操作呀,test只JSP内置对象中存放的东西。除非你的判断结果已经在后台保存在了reqeust对象中。否只能在前天通过JS了。
      

  3.   

    使用JQuery:var chks = $("input[type=checkbox][name=xxx]:checked"); // 指定名称的checkbox中选中的集合.