PDA

View Full Version : Help with form redirect after submit.



missileman
01-07-2013, 07:36 PM
Hello all,

<input type="image" src="images/pay-now-pp.gif" alt="Pay with PayPal" onClick="SetCookie ('NumberOrdered', 0, null, '/');document.location=('redirect.html')">

I use the above code to submit a shopping cart total to PayPal and then redirect to a thank you page. It works fine in IE and FireFox.

In Chrome, it will send the cart contents to PayPal but will not redirect to the thank you page.

I have tried window.location, window.open, window.location.href= but none of them work in Chrome.

Any suggestions???

Thanks,
missileman

missileman
01-08-2013, 04:43 PM
Apparently Chrome does not like the word redirect???

I have a work around and it involves using a timer:
<input type="image" src="images/pay-now-pp.gif" alt="Pay with PayPal" onClick="SetCookie ('NumberOrdered', 0, null, '/');javascript:timer=setTimeout('move()',5000)">

onClick sends the contents of the cart right to PayPal in a new tab/window and the cart page is sent to my redirect.html Thank You Page.

The js timer code:

<script type="text/javascript">
var time = null
function move() {
window.location = 'redirect.html'
}
//-->
</script>