I am trying (1) to submit the form to an external website, which should be launched in a new tab, and at the same time (2) redirect the browser window with the form to the page with gratitude.
My code works in Firefox and Internet Explorer and will execute either part (1) or part (2) in Chrome / Safari if I delete another part.
<script> function testfunc() { alert('Submit Clicked'); jQuery('form#getaQuote').submit(); alert('Form submit attempted'); window.location.href = ('http://ct.athiel.ca'); alert('Redirect attempted'); } </script> <form id="getaQuote" action="http://www.winquote.net/complete.pl" target="_blank"> <input type="text" name="field1" /> <input type="button" value="Submit" onclick="testfunc()" /> </form>
Here you can try the code ---> http://jsfiddle.net/GjyMd/7/
Any help would be appreciated, this problem goes over my head.
source share