title: Submit form with Javascript doesn't work
body: <p>I have a simple form for uploading a file.  If I use an ordinary submit button, everything works as expected:</p>
  
  <pre><code>&lt;form id="mainform" method="post" action="/" enctype="multipart/form-data"&gt;
  ...
  &lt;input type="submit" id="submit" value="Analyze File"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>But if I change it to an ordinary button and use Javascript to submit the form, nothing happens:</p>
  
  <pre><code>&lt;input type="button" id="submit" value="Analyze File" onclick="document.getElementById('mainform').submit()"/&gt;
  </code></pre>
  
  <p>I verified that the onclick handler really is getting called, and looking up the form works correctly.  For example, if I change it to <code>onclick="alert(document.getElementById('mainform').action)"</code>, the alert comes up as expected and shows the target URL of the form.  But for some reason, the call to submit() simply doesn't submit the form.</p>