title: How to prevent document.forms[0].submit() from submitting a form?
body: <p>This is basically my form:</p>
  
  <pre><code>&lt;form method="post" action="" onsubmit="checkallfields(); event.preventDefault();"&gt;
    &lt;!-- My Stuff --&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And it is the first form on my page. I have client-side field validation, which obviously is stored in the function <code>checkallfields()</code>. But the problem is, that the user can be very naughty and open up the console and type <code>document.forms[0].submit()</code>, and then the form will still submit.</p>
  
  <p>How do I prevent this?</p>