title: Javascript form submit to popup window with target
body: <p>I Want to submit a form to a popup window (not blank). This works fine but for some reason my parentwindow is opened for a 2nd time.</p>
  
  <pre><code> var formelements = document.getElementById("exportform");
   formelements.removeAttribute("action");
   formelements.setAttribute("target","/path/exportwindow.html");
   exportwindow = window.open("/path/exportwindow.html", "myexportwindow", "width=800,height=600,resizable=yes");                                         
  
   formelements.submit();
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form id="exportform" action="/path/myfunction" method="post"&gt;
  </code></pre>
  
  <p>So what happens is that the popup window opens and in the background my parent window is opened to a new tab. Can anyone tell me why js is behaving like this?</p>