title: AJAX for redirecting to external domain when submitting form
body: <p>I have a form as so, which submits data to an outside domain:</p>
  
  <pre><code>&lt;form action="https://EXTERNALdomain.com/register" id="form_register" method="POST"&gt;
  
    &lt;input type="text" id="first-name" name="first-name" value="" placeholder="First Name" required/&gt;
    &lt;input type="text" id="last-name" name="last-name" value="" placeholder="Last Name" required/&gt;
    &lt;input type="email" id="email" value="" name="email" placeholder="Email Address" required/&gt;
    &lt;input type="password" id="password" name="password" placeholder="Password" required/&gt;
  
    &lt;input type="submit" value="Create Account" /&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>However, I'm trying to be able to submit the form AND redirect it to a different page, also externally. So far, my attempts have been unsuccessful with AJAX.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function sform() {
      $.ajax({
          url: "https://EXTERNALdomain.com/home",
          data: $('#request').serialize(),
          type: 'POST',
          success: function (resp) {
              alert(resp);
          },
          error: function(e) {
              alert('Error: '+e);
          }  
     });
  }
  </code></pre>
  
  <p></p>
  
  <p>I've then been calling the form as so:</p>
  
  <pre><code>&lt;form onsubmit="sform()" id="request"&gt;
  </code></pre>
  
  <p>This isn't working. I just get a long URL, and the form doesn't actually post, the page just reloads</p>