title: Different form action according to different submit button
body: <p>If I have a form which have 2 buttons , and when I click Button1 then it will be <code>action="submit1.php"</code> , if Button2 then <code>action="submit2.php"</code>.</p>
  
  <p>I tried this:</p>
  
  <pre><code>  &lt;script language="javascript"&gt;
  
    function Button1()
     {
       document.Form1.action = "submit1.php"   
       document.Form1.target = "iframe1";    
       document.Form1.submit();        
  
     }
  
    function Button2()
     {
      document.Form1.action = "submit2.php" ;
      document.Form1.target = "iframe2";    
      document.Form1.submit();       
     }
  
   &lt;/script&gt;
  </code></pre>
  
  <p>Somewhere in the <code>&lt;body&gt;</code>:</p>
  
  <pre><code>  &lt;div style="visibility:hidden"&gt;
    &lt;iframe NAME="iframe1" WIDTH="40" HEIGHT="40"&gt;&lt;/iframe&gt;
    &lt;iframe NAME="iframe2" WIDTH="40" HEIGHT="40"&gt;&lt;/iframe&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>And in the form:</p>
  
  <pre><code>  &lt;form name="Form1" id="Form1" method="post"&gt;
    &lt;input type="submit" name="Button1" onclick="Button1();"&gt;
    &lt;input type="submit" name="Button2" onclick="Button2();"&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>It's not working , am I make anything wrong?</p>
  
  <p>Thank you.</p>