how to fix this, JavaScript Error : document.forms. is null not an Object
<p>in my jsp page, I am getting script error.  <strong>error message is : document.forms[0] is null not an object.</strong>when i click  to SignOut . sign Out works fine and it is redirect to default.jsp. but my default.jsp doesn't show anything just a blank page. I checked view Source of  default.jsp page.The whole page is not loaded. it has loaded only till <strong>1st line of body tag.</strong> Below is the code for <strong>default.jsp .</strong></p>

<pre><code> &lt;! doctype html&gt;
 &lt;html language="en"&gt;
 &lt;%@  page language="java" contentType="text/html" %&gt;
&lt;%@ session ="false" %&gt;

&lt;head&gt;
&lt;script type="text/javascript"&gt;

function closeWarning(){

        document.forms[0].reset();

 }
     &lt;/script&gt;
&lt;/head&gt;

 &lt;body onLoad="closeWarning();" class="page-design"&gt;// page loaded till here
 &lt;jsp:include flush="true" page="/myCart/header.jsp"/&gt;
//---other component of body----
 &lt;/body&gt;
</code></pre>

<p>please suggest something how to resolve this. Thanks .</p>
