1
function checkAll(custId){
var id;
if(document.getElementById(custId).checked == true){
<%for (CustomerGroup custGroup : customerGroupList) {%>
if(custId==<%=custGroup.getCustomerGroupId()%>){
<%List<Account> list = accountDelegate
.findAccountEntityByGroupId(custGroup
.getCustomerGroupId());
for (Account account : list) {%>
id=<%=account.getAccountId()%>
document.getElementById(id).checked=true;
<%}%>
}
<%}%>
}else {
<%for (CustomerGroup custGroup : customerGroupList) {%>
if(custId==<%=custGroup.getCustomerGroupId()%>){
<%List<Account> list2 = accountDelegate
.findAccountEntityByGroupId(custGroup
.getCustomerGroupId());
for (Account account : list2) {%>
id=<%=account.getAccountId()%>
document.getElementById(id).checked=false;
<%}%>
}
<%}%>
}
}
在這裏,我已經通過了CUSTID作爲checkbox.Problem的ID這裏,如果(的document.getElementById(CUSTID).checked ==真怎麼知道天氣複選框選中或不使用JavaScript
每次這。?。條件將評估爲false,從而控制進上的其他部分 所以,我怎麼能知道閹複選框cheched或不
沒有這個答案提供哪些額外的信息是不是已經在對方的回答給定的?另外,在這種情況下進行隱式類型轉換('test.checked == 1')真的讓人困惑。 – 2013-04-11 12:02:51