title: jQuery page redirect after submit the form
body: <p>I have a form like this</p>
  
  <pre><code>&lt;form id="add-to-cart" name="my-form" action="http://www.example.com" method="post"&gt;
    &lt;div class="row flat"&gt;
      &lt;input type="hidden" name="cartkey" value=""&gt;
      &lt;input type="hidden" name="id" value="2"&gt;
      &lt;button type="submit"  value="submit" data-value="2" data-name="id"&gt;Buy Now&lt;/button&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>To Save the form I have used jQuery. So for now my code looks like this</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
      jQuery(document).ready(function() {
        jQuery('button').click(function(){
          var Value = jQuery(this).attr('data-value');
          jQuery('[name="id"]').val(Value);
          jQuery('#add-to-cart').submit();
          window.location = "http://www.page-2.com";
          });
      });
    &lt;/script&gt;
  </code></pre>
  
  <p>But here after submit the form is not redirecting to another page(<a href="http://www.page-2.com" rel="nofollow">http://www.page-2.com</a>).
    So can someone kindly tell me how to do redirect the form after submit the form?</p>
  
  <p><strong>Update</strong>
  Sorry here I can't use ajax. I want to submit the form in simple.</p>