How to CLOSE the POPUP window, and redirect to the current browser - after the submit button is selected?

  • Profile Image
    Asked on February 13, 2012 at 08:17 PM

    I'm having some issues with the POPUP window. When my visitor clicks on the 'request' for more information, upon filling out a brief POPUP form, I'd like to have the POPUP window close - redirecting the visitor to the same browser window that they were in when the selelcted the 'request' button - redrecting to the 'Thank you for requesting..." landing page. 


    Right now, I have samples of the for for a demonstration to my client - when he slected the 'request' button, the POPUP is presented - when he selects SUBMIT, the POPUP window presents the 'success' page but the POPUP window has to be closed manually. Here's the link:  Thank you for your assistance. I'm turned on many clients to your service (Annapolis Opera, for example) - John

  • Profile Image
    Answered on February 14, 2012 at 06:33 AM

    Create another webpage on your webserver & use that as the Custom URL thankyou page for your form.

    In that new webpage have just one line of code.

    <body onload="javascript:window.opener.childClosed();window.close();">


    That code will call a javascript function in the parent window and then close the child popup; you can then use that javascript function to do a redirect on your parent page. 

    I am not to sure where the URL of your 'Thank you for requesting...' page is, but here is some javascript to redirect to google on your parent page after the form is submitted.


    <script type="text/javascript">   

      function childClosed() {

        window.location = ""




    You can put that script before your closing <body> tag. 


    Hopefully I have understood your query OK, let me know if you have any questions or need any clarification on this possible solution. 


    I have made a very basic clone of your webpage & form here if you want to test out the functionality, 'Factoring Question?' is the link that contains this code. 


  • Profile Image
    Answered on November 18, 2015 at 11:26 AM

    Hi, i tried this with the bigCommerce, but i am not able to land on the Parent page.

    I crerated a page with the script but it just displays the title only instead of redirect.

    Do i have to add the childClosed() ? where should I add this .


  • Profile Image
    Answered on November 18, 2015 at 12:39 PM


    This thread is quite old and was dated way back 2012, I have opened a separate thread so that we can better discuss your concern. Please refer to this link instead: We will address it accordingly.

    Thank you for your understanding.

  • Profile Image
    Answered on January 28, 2016 at 11:55 PM

    Thanks A lot I ....