title: html input is calling wrong action
body: <p>I'm try to perform different actions in a login form with 2 button. The first is a logout button, and the second would perform email sending. See my code below:</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>&lt;form action="xxx/default_logout.php" method="post" id="login form"&gt;
  
      &lt;!-- Logout button --&gt;
      &lt;div style="float: left; width: 20%"&gt;
         &lt;input type="submit" name="Submit" id="button-setting" value="Logout"/&gt;
         &lt;input type="hidden" name="option" value="com_users" /&gt;
         &lt;input type="hidden" name="task" value="user.logout" /&gt;
         &lt;input type="hidden" name="return" value="&lt;?php echo $return; ?&gt;" /&gt;
         &lt;?php echo JHtml::_('form.token');
      &lt;/div&gt;
  
      &lt;!-- Mail button --&gt;
      &lt;div style="float: right; width: 66%"&gt;
         &lt;div&gt;
              &lt;form action='xxxxx/mail.php' method="post"&gt; 
                  &lt;input type="submit" name="Submit" id="buttonR-setting" value="Mail"/&gt;
                  &lt;input type="hidden" name="option" value="com_users" /&gt;
                  &lt;?php echo JHtml::_('form.token'); ?&gt;
              &lt;/form&gt;
         &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>Problem</strong></p>
  
  <p>It always jump to <code>logout.php</code> whether I click <code>logout</code> or <code>mail</code>, but I expected <em>logout</em> would goto <code>logout.php</code> while <em>mail</em> would goto <code>mail.php</code>. </p>
  
  <p><strong>Question</strong> </p>
  
  <p>I want to know</p>
  
  <p>(i) how to fix the code, noted that I want both <code>logout</code> &amp; <code>mail</code> be the components of the form <em>and</em></p>
  
  <p>(ii) what is the mechanism between <code>submit</code> and <code>action</code>, how do they bind together.</p>
  
  <p>Any help would be very much appreciative.</p>
  
  <p><strong>Update</strong></p>
  
  <p>So far, I've try to execute it by JavaScript. Unfortunately, It still doesn't work.</p>
  
  <pre><code>&lt;form action='xxxxx/mail.php' method="post" id="mail_form"&gt; 
  &lt;input type="submit" onClick="myFunction()" name="Submit" id="buttonR-setting" value="Mail"/&gt;
  &lt;/form&gt;
  &lt;script&gt;
      function myFunction(){
          document.getElementById('mail_form').submit()
      }
  &lt;/script&gt;
  </code></pre>