M
Man-wai Chang
Is there a more elegant solution than this?
function checkUncheckAll(theElement) {
var theForm = theElement.form, z = 0;
for (z=0; z<theForm.length;z++) {
if (theForm[z].type == 'checkbox' && theForm[z].name != 'checkall') {
var lnIndex=theForm[z].name.substr(6,theForm[z].name.length-1);
if (document.getElementById("txtStatus"+lnIndex).value=="D") {
if (theElement.checked==true) {
theForm[z].checked=confirm(....);
}
} else {
theForm[z].checked=theElement.checked;
}
}
}
}
function checkUncheckAll(theElement) {
var theForm = theElement.form, z = 0;
for (z=0; z<theForm.length;z++) {
if (theForm[z].type == 'checkbox' && theForm[z].name != 'checkall') {
var lnIndex=theForm[z].name.substr(6,theForm[z].name.length-1);
if (document.getElementById("txtStatus"+lnIndex).value=="D") {
if (theElement.checked==true) {
theForm[z].checked=confirm(....);
}
} else {
theForm[z].checked=theElement.checked;
}
}
}
}