View Full Version : Javascript form submit and page redirect script not working in Safari 4.05

03-24-2010, 02:54 PM

I have a very simple script that submits a form to a payment site (opening it in a new window) and then redirects the parent screen to a thankyou page.

this works fine in IE and Firefox, but not in Safari 4.05, I think it worked in the previous safari, but can't remember tbh!

the script goes like this:

<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
function submitMyForm() {
window.location = "http://www.mySite/thanks.htm";

and the form is:

<form id="form1" name="form1" method="post" action="http://www.myPaymentSite/payMe.asp" target="_blank">
<input type="text" value="test" />
<input type="button" name="btnSubmit" id="btnSubmit" value="Make Payment" onclick="javascript:submitMyForm()" />

both parts of the script work fine seperately, but when run together safari doesn't open the new window, but does redirect the parent page. I've tried turning off the pop up blocker in safari, and that doesn't affect it (it shouldn't as I'm not popping anything up, just opening a new window)

any clues as to why this isn't working in Safari would be gratefully received, it's driving me barmy!