How can you go to two pages at once, on form submission?
I hope you may be able to help as I don't know how possible this is:
I've currently got an online form (within a secure members log in area) which on form submission, takes the user through to external secure payment facilities to update their account credits (The payment site being WorldPay).
At the moment the external payment site opens up in the same browser window, and therefore when the customer finishes making a payment, they've already been logged out of the members area (ie to stop others using the history list to find their way into the secure area).
However, having to log in again after making a payment, is a hassle I'd rather avoid for members in this situation.
The plan was thus to set the target="_blank" to open up a new window for the secure payment in the 'form action' code (ie. <form action="https://select.worldpay.com/wcc/purchase" target="_blank" method="post"> if this works!) But at the same time, also change the location of the original window to a new thank you page (ie redirect to /members/thank_you.html ).
So is this possible? And can it be done in such as way that the user only sees the updated original page after they close the WorldPay screen? (rather than going back to seeing the form they've already completed on closing the external payment window?)
Re: How can you go to two pages at once, on form submission?
Originally posted by happy_hands The plan was thus to set the target="_blank" to open up a new window for the secure payment in the 'form action' code (ie. <form action="https://select.worldpay.com/wcc/purchase" target="_blank" method="post"> if this works!) But at the same time, also change the location of the original window to a new thank you page (ie redirect to /members/thank_you.html ).
You could modify the FORM tag to look something like this:
Originally posted by happy_hands And can it be done in such as way that the user only sees the updated original page after they close the WorldPay screen? (rather than going back to seeing the form they've already completed on closing the external payment window?)
Do you want to redirect the page again after the user closes the WorldPay window?
Thousand different paths
So many sterile ends
I chose the Devil's path
Never shall the sun kiss my face
And caress me with it's burning light
For I dwell in the shadows
And sleep side by side with death
Thank you (I was hoping it would be something relatively simple to do).
I've tested that out, and it works just the way I was thinking in advance it would.
Do you want to redirect the page again after the user closes the WorldPay window?
This was something I hadn't though of though, but thinking about it, actually be even better! Thus I could have a temporary message saying 'please complete your payment in the accompanying window...' (in case they didn't see the new popup window) and then when they finish, it would take them automatically to the booking page where they could use the Therapy Credits just purchased!
hmmm.. not sure if that's possible though without going into too much extra coding, whilst also using the Worldpay servers.
It works now though as described the first time, so thank you Paul.
If you want to redirect the page again after the user closes the WorldPay window, you’ll probably have to go post in the JavaScript section. I tooled around for a bit, but I wasn’t able to come up with anything that worked. My JavaScript skills are way rusty.
Thousand different paths
So many sterile ends
I chose the Devil's path
Never shall the sun kiss my face
And caress me with it's burning light
For I dwell in the shadows
And sleep side by side with death
Bookmarks