title: Automatically Submitting a Form WITH Submit Button Parameters
body: <p>I am using the following code to submit a form automatically:</p>
  
  <pre><code>&lt;form id="reg_form" name="reg_form" method="post" action="../mm2/register.php" &gt;
  &lt;input  ..... /&gt;
  &lt;input  ..... /&gt;
  &lt;script type="text/javascript"&gt;
  document.reg_form.submit(); // SUBMIT FORM
  &lt;/script&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>However, the manual way I was submitting it was using the following button:</p>
  
  <pre><code>&lt;input type="submit" name="save_user" value="   Register  &gt;&gt; " &gt;
  </code></pre>
  
  <p>The problem is the file where the "action" parameter send the data (register.php) READS THE "name" attribute OF THE SUBMIT BUTTON and executes different code based on whether it sees it or not. 
  In other words, I get a different results when I submit using the automatic method or the button.</p>
  
  <p>When I use the submit button, all is well. But when I use the automatic submission method, I get on undesired result. </p>
  
  <p>I DO NOT have access to the "register.php" file to modify this behavior. </p>
  
  <p>Is there any way I can automatically submit a form as if it was sent using a button with a particular "name" attribute?</p>
  
  <p>Thanks for any help!</p>