title: OPEN PHP ACTION AFTER CLICKING SUBMIT BUTTON ON A NEW BROWSER/WINDOW
body: <p>Good Day, I am trying to make this code run on a new window; Below is my code:</p>
  
  <p>TEST1.PHP</p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;
  
  &lt;script&gt;
      function submitForm(action)
      {
          document.getElementById('1').action = action;
          document.getElementById('1').submit();
      }
  &lt;/script&gt;
  
  &lt;title&gt;test&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;form id="1" name="test-1" action="test3.php" method="post"&gt;
  &lt;input name="fname"&gt;&lt;input name="lname"&gt;&lt;br&gt;
  
  &lt;input value="Save" name="save" )="" type="submit"&gt;
  &lt;input value="Nwindow" name="nwindow" onclick="submitForm('test2.php');
  window.open='test2.php'" type="submit"&gt;
  </code></pre>
  
  <p>
     </p>
  
  <p>TEST2.PHP</p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;
  &lt;form id="2" name="test-2" action="test2.php" method="post"&gt;
  &lt;title&gt;test&lt;/title&gt;&lt;/head&gt;&lt;body&gt;
  
  &lt;input name="fname" value="&lt;?php echo $_POST['fname']; ?&gt;"&gt;
  &lt;input name="lname" value="&lt;?php echo $_POST['lname']; ?&gt;"&gt;
  &lt;br&gt;
  &lt;/form&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>They both work correctly but what i wanted for nwindow button to perform TEST2.PHP on another window/browser; I tried window open but it is not working.</p>
  
  <p>I am new with javascript so i am not sure it this can be done.</p>
  
  <p>Any help is much appreciated.</p>
  
  <p>Thanks in Advance.</p>