title: Javascript form submit open new window tab, and then redirect parent page
body: <p>When I submit the form I'm trying to open a new window tab and pass the values over into the new window tab. Then I need the parent page to redirect to the next page.</p>
  
  <p>The problem is the form values are not passing to the new window tab.
  How could I do that with the following code I have right now?</p>
  
  <pre><code>&lt;form class="form" id="promo_form" method="post"&gt;
  &lt;input type="text" name="first_name" id="first_name"&gt;
  &lt;input type="text" name="last_name" id="last_name"&gt;
  &lt;input type="text" name="zipcode" id="zipcode" maxlength="5"&gt;
  &lt;button type="submit" id="promo_form_button" class="submit"&gt;Continue&lt;/button&gt;
  &lt;/form&gt;
  
  
  $(document).ready(function($){
  
  var form = document.getElementById("promo_form");
  
      function goToUrl(){
          window.open("https://site.com/new-tab", "_blank");
          window.location = "https://site.com/parent-next-page"
      }
  
      document.getElementById("promo_form_button").onclick = goToUrl;
  });
  </code></pre>