我的問題是我想在頁面加載時檢查我的複選框。如何在頁面加載時使用jquery檢查複選框
這些複選框目前在用戶形式的端部,如下圖所示:
每個複選框對應於規範對象。 在我modelmap,我加入一個包含檢查值的「規範」名單,以及包含所有值的「allspecification」的文章:
List<Specification> specification=hot*******.get********otel(createHotel); //this is for check value.
List<Specification> allspecification=city****vice.getspec***fication(); //for all specification
map.addAttribute("orgspecification", specification);
map.addAttribute("allToatalspecfication", allspecification);
以下是相應的JSP頁面:
<div id="orgspecifications" style="margin-left:1px; height: 100px; width: 97%;">
<c:forEach step="1" items="${allToatalspecfication}" var="specification">
<div align="left" id="${specification.id}" style="width: 28%; color: #507B07; border: solid 1px gray; float: left; margin: 3px; height: 27px; background-color: #E9EBE3;">
<input type="checkbox" name="checkbox" value="${specification.id}" id="checkbox" class="selectall"/>
${specification.name}
</div>
</c:forEach>
</div>
的事情是,我正在顯示所有「全部規格」列表,但我也希望檢查「規格」列表中的元素。 如何才能實現頁面加載?
在此先感謝。
好的解決問題... – ASUR