Where did I make a Javascript error in this short section of code?
<p>I have made a short demo of a javascript problem.  When the Submit button is clicked, the alert pops up informing the user that a blank value is not allowed, which is good.  But then the page submits anyways, which is bad.</p>

<p>It seems this behavior is only happending on hidden fields.</p>

<p>(Its more clear if you enter any value into the name field. Click Submit. I know the page submits because the value in Name clears out.)</p>

<p>Can anyone see what is wrong here?</p>

<pre><code>&lt;html&gt;
&lt;body&gt;

&lt;form action="" method="post" name="form" onsubmit='return validate()'&gt;

Name: &lt;input type="text" name="name" id="name"&gt;

&lt;br&gt;&lt;br&gt;Signature: Hidden &lt;input type="hidden" name="poa_esign_signature" id="poa_esign_signature"&gt;

&lt;br&gt;&lt;br&gt;&lt;button type="submit"&gt;Sign&lt;/button&gt;

&lt;/form&gt;

&lt;script type="text/javascript"&gt;
function validate() {
  var element=document.getElementById('poa_esign_signature');
  if (element.value=='') {
    alert('Signature may not be blank.');
    element.focus();
    return false;
  }
}
&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
