function checkAll(bx,dg) {
var tbl = document.getElementById(dg);
for (var index = 1; index < tbl.rows.length; index++) {
var cbs = tbl.rows[index].getElementsByTagName('input');
for (var i = 0; i < cbs.length; i++) {
if (cbs[i].type == 'checkbox') {
if (cbs[i].disabled == false) {
cbs[i].checked = bx.checked;
//alert(cbs[i].disabled);
}
}
}
}
}
ex: <input type="checkbox" id="chkAll" onclick="checkAll(this,'tableId" />
var tbl = document.getElementById(dg);
for (var index = 1; index < tbl.rows.length; index++) {
var cbs = tbl.rows[index].getElementsByTagName('input');
for (var i = 0; i < cbs.length; i++) {
if (cbs[i].type == 'checkbox') {
if (cbs[i].disabled == false) {
cbs[i].checked = bx.checked;
//alert(cbs[i].disabled);
}
}
}
}
}
ex: <input type="checkbox" id="chkAll" onclick="checkAll(this,'tableId" />
Comments
Post a Comment