循环项列表,带有jsp中的复选框

时间:2012-12-05 10:24:40

标签: html jsp struts2

之前我使用列表显示为选择框。

<select name="chosenList">
    <c:forEach>
    ...
    </c:forEach>
</select>

现在我想用复选框和数据显示该列表,类似于<input type="checkbox" /> This is checkbox <br />。如何通过复选框循环并显示每个数据?

1 个答案:

答案 0 :(得分:0)

不工作,你可以摆脱复选框并使用

<select multiple>
   <c:forEach>
        <option>press ctrl+lmb</option>
   </c:forEach>
</select>

循环复选框,不选择

<c:forEach><label><checkbox />clickme</label></c:forEach>

此致