E
evanburen
When I click on the "Check All" checkbox, it correctly checks all of
the boxes in my form, but I would like each checkbox to also call
hideLayer2 function just as
what would occur if the user checked the boxes individually. Is there
a way to call the hideLayer2 function and pass the correct whichLayer
and the_box parameters
within the DoToAll function? Maybe there is an easier way? Thanks.
<form name="frmCheckboxes" action="panelstatus.asp" method="post">
<input type="checkbox" onclick="DoToAll(this)">Check All:
<input type="checkbox" name ="chkCompanyBoard"
onClick="hideLayer2('CompanyBoard',this);">Company and Board
Description<br />
<input type="checkbox" name ="chkEvents"
onClick="hideLayer2('Events',this);">Events Reported For This
Company<br />
<input type="checkbox" name ="chkAboutBoard"
onClick="hideLayer2('AboutBoard',this);">About the Board<br />
</form>
function DoToAll(obj_input)
{ bol_is_checked = (obj_input.checked)?true:false
for (x=0;x<obj_input.form.length;x++)
{ obj_input.form.elements[x].checked = bol_is_checked;
}
}
function hideLayer2(whichLayer,the_box)
{
if (the_box.checked == false) {
document.getElementById(whichLayer).style.display = 'none';
var strshowhide=0;
frmPanelStatus.location.href="panelstatus.asp?showhide=" +
strshowhide + "&whichLayer=" + whichLayer;
} else {
document.getElementById(whichLayer).style.display = 'inline';
var strshowhide=1;
frmPanelStatus.location.href="panelstatus.asp?showhide=" +
strshowhide + "&whichLayer=" + whichLayer;
}
}
the boxes in my form, but I would like each checkbox to also call
hideLayer2 function just as
what would occur if the user checked the boxes individually. Is there
a way to call the hideLayer2 function and pass the correct whichLayer
and the_box parameters
within the DoToAll function? Maybe there is an easier way? Thanks.
<form name="frmCheckboxes" action="panelstatus.asp" method="post">
<input type="checkbox" onclick="DoToAll(this)">Check All:
<input type="checkbox" name ="chkCompanyBoard"
onClick="hideLayer2('CompanyBoard',this);">Company and Board
Description<br />
<input type="checkbox" name ="chkEvents"
onClick="hideLayer2('Events',this);">Events Reported For This
Company<br />
<input type="checkbox" name ="chkAboutBoard"
onClick="hideLayer2('AboutBoard',this);">About the Board<br />
</form>
function DoToAll(obj_input)
{ bol_is_checked = (obj_input.checked)?true:false
for (x=0;x<obj_input.form.length;x++)
{ obj_input.form.elements[x].checked = bol_is_checked;
}
}
function hideLayer2(whichLayer,the_box)
{
if (the_box.checked == false) {
document.getElementById(whichLayer).style.display = 'none';
var strshowhide=0;
frmPanelStatus.location.href="panelstatus.asp?showhide=" +
strshowhide + "&whichLayer=" + whichLayer;
} else {
document.getElementById(whichLayer).style.display = 'inline';
var strshowhide=1;
frmPanelStatus.location.href="panelstatus.asp?showhide=" +
strshowhide + "&whichLayer=" + whichLayer;
}
}