title: Form submit with javascript and input required
body: <p>I was trying to submit things using a div, HTML5, JavaScript. If I use a submit button the validator (required attribute in the inputs) works the button doesn't submit info. But if I use a div tag it doesn't validate and  send the info. Any way to fix it? Or should I do the whole code to validate the info and stop the submit?</p>
  <pre class="lang-html prettyprint-override"><code>&lt;form action=&quot;index.php&quot; method=&quot;get&quot; name='myform'&gt;
    &lt;ul&gt;
      &lt;li class=&quot;row&quot;&gt;
        &lt;label class=&quot;labels&quot; for=&quot;username&quot;&gt;Username&lt;/label&gt;
        &lt;input type=&quot;text&quot; id=&quot;txtUser&quot; required&gt;
      &lt;/li&gt;
      &lt;li class=&quot;row&quot;&gt;
        &lt;label class=&quot;labels&quot; for=&quot;password&quot;&gt;Password&lt;/label&gt;
        &lt;input type=&quot;password&quot; id=&quot;txtPass&quot; required&gt;
      &lt;/li&gt;
      &lt;li id=&quot;row2&quot;&gt;
        &lt;div class=&quot;button&quot;&gt;&lt;a href=&quot;javascript: submitform()&quot;&gt;Submit&lt;/a&gt;&lt;/div&gt;
        &lt;input type=&quot;submit&quot;&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/form&gt;
  </code></pre>
  <p><a href="http://www.dropmocks.com/mCyfGJ" rel="nofollow noreferrer">http://www.dropmocks.com/mCyfGJ</a></p>
  <p>Im using the following code.
  Javascript submit:
  <a href="http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml" rel="nofollow noreferrer">http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml</a></p>
  <p>HTML</p>
  <p>enter code here</p>