Resetting a form with JavaScript
<p>i am resetting my form with the following:</p>

<pre><code>&lt;script type="text/javascript"&gt;

window.onload = function () {
document.getElementsByName("email_address")[0].value = "";
document.getElementsByName("remove")[0].value = "off";
}



&lt;/script&gt;
</code></pre>

<p>the problem is that the checkbox "remove" seems to get reset before the server side script can run. So in effect what ever the user selected on the checkbox is overridden and set to off before the php script can be run.  Yet, the input box "email_address" is fine...</p>

<p>the test...</p>

<pre><code>//this is already set to OFF by the time we get here....even if the user may have ticked the checkbox to ON
echo $HTTP_GET_VARS['remove'];

//this is fine, the email_address input is read and not reset...
echo $HTTP_GET_VARS['email_address'];
</code></pre>

<p>can any one explain this?
I obviously want the form to be reset AFTER my server side script is done processing , yet for some reason it resets the checkbox early, yet the input box is ok...</p>

<p>thank you!</p>
