Why the following code has the error: 'document.mainform.unknownHw' is null or not an object?
function setUnknownHw(unknownHw)
{
document.mainform.unknownHw.checked = unknownHw;
}
<div class="special">
<form name="mainform" id="mainform" action="display.htm" method="post">
<br><br><input type="checkbox" name="unknownHw" onClick="setdbUnknownHw(this)">Unknown Hw
<input type="submit" value="Apply" onClick="setdbRowsPerPage()"><br>
</form>
</div>