Help submitting a form
<p>This was working but has suddenly stopped for some reason. I can't see what's wrong. Can someone tell me what I am doing wrong here? I'm using an onclick event in a span tag then calling this function.</p>

<p>Firefox reports: <code>Error: document.forms[0].submit is not a function</code></p>

<pre><code>  function submitlogin() {
    document.forms[0].submit()
  }
&lt;form method="post" id="submit" action="something.asp"&gt;
 &lt;span id="button" onclick="submitlogin()"&gt;&lt;/span&gt;
&lt;/form&gt;
</code></pre>

<hr>

<p>This is what the form looks like</p>

<pre><code>  &lt;form method="post" id="myform" action=""&gt;
    &lt;div&gt;
      &lt;input type="text" id="name" name="name" /&gt;
    &lt;/div&gt;
    &lt;div id="btn-container"&gt;
      &lt;span id="button" onclick="submitlogin();"&gt;&lt;/span&gt;
    &lt;/div&gt;
  &lt;/form&gt;
</code></pre>
