I'm trying to resolve whether or not a checkbox is checked. It seems rather straight forward.
<script type="text/Javascript">
function ValidateReqNum() {
var zCheckBox = document.getElementById('chkAllJobs');
if (zCheckBox.checked)
alert("true");
if (!zCheckBox.checked)
alert("false");
return true;
}
</script>
and the checkbox:
<asp:CheckBox ID="chkAllJobs" runat="server" Text="All Jobs" />
called from:
<asp:Button ID="btnPrintReport" runat="server" Text="Run Report"
OnClientClick="return ValidateReqNum();" OnClick="CreatePDFJobReport" />
I've tried it dozens of different ways and it keeps coming back with
Error: Unable to get value of the property 'checked': object is null or undefined
My other elements in the same aspx page are reporting in just fine. I can call chkAllJobs from my c# code and I can resolve whether or not it's checked from c# as well.