title: document.[form element] is undefined
body: <p>I have an HTML form that is defined like this:</p>
  
  <pre><code>&lt;form name="myForm" id="myForm"&gt;
  &lt;input type="checkbox" name="chkMyCheckbox" id="chkMyCheckbox"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I am simply trying to get the value of the checkbox in window.onload. For that, I do this: </p>
  
  <pre><code>window.onload = function()
  {
     var checkboxValue = document.myForm.chkMyCheckbox.checked;
  }
  </code></pre>
  
  <p>On loading the page, I receive the error "document.myForm is undefined". If I'm referencing the form after the page is loaded, why am I seeing this error? </p>