title: Required attribute not working using javascript submit
body: <p>I make some form different action within different button</p>
  
  <pre><code>&lt;form id="form" method="post" class="form-horizontal" enctype="multipart/form-data"&gt;
      &lt;input name="name" class="form-control" type="text" required&gt;
  &lt;/form&gt;
  &lt;button type="button" class="btn btn-primary" onClick="submitForm('&lt;?php echo base_url('order/add');?&gt;')"&gt;Submit&lt;/button&gt;
  &lt;button type="button" class="btn btn-warning" onClick="submitForm('&lt;?php echo base_url('order/print');?&gt;')"&gt;Print&lt;/button&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>function submitForm(action)
  {
      document.getElementById('form').action = action;
      document.getElementById('form').submit(
  
      );
  }
  </code></pre>
  
  <p>Then, my required attribute not working. Did I do something wrong? Let me know if there is other solution.
  Thanks,</p>