title: HTML5 validation when the input type is not "submit"
body: <p>I'm using HTML5 for validating fields. I'm submitting the form using JavaScript on a button click. But the HTML5 validation doesn't work. It works only when then input type is <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/submit" rel="noreferrer"><code>submit</code></a>. Can we do anything other than using JavaScript validation or changing the type to <code>submit</code>?</p>
  
  <p>This is the HTML code:</p>
  
  <pre><code>&lt;input type="text" id="example" name="example" value="" required&gt;
  &lt;button type="button"  onclick="submitform()" id="save"&gt;Save&lt;/button&gt;
  </code></pre>
  
  <p>I'm submitting the form in the function <code>submitform()</code>.</p>