www.webdeveloper.com
Results 1 to 6 of 6

Thread: How can you go to two pages at once, on form submission?

  1. #1
    Join Date
    Jul 2004
    Location
    Reading, UK.
    Posts
    104

    Post 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?)

  2. #2
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004

    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:
    Code:
    <form action="https://select.worldpay.com/wcc/purchase" 
    onsubmit="window.location = 'thankyou.html';" target="_blank" method="post">
    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

  3. #3
    Join Date
    Jul 2004
    Location
    Reading, UK.
    Posts
    104
    That works!

    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.

  4. #4
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    I’m glad that worked for you.

    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

  5. #5
    Join Date
    Jul 2004
    Location
    Reading, UK.
    Posts
    104

    Thumbs up

    Not to worry. But thank you for trying to work it out.

  6. #6
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    You’re welcome.
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles