What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Close pop up form and land on a different page URL?

    Asked by mysizeclothes on November 18, 2015 at 12:37 PM

    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 .

    -thx

  • Profile Image
    JotForm Support

    Answered by Charlie on November 18, 2015 at 12:42 PM

    Could you please provide us more details on how your form is setup?

    What embed code you are using and how does your process flow works? You could also share us the website to where your form is embedded so that we can better check it.

    We'll wait for your response.

  • Profile Image

    Answered by mysizeclothes on November 18, 2015 at 02:13 PM

    hi thx for the response.

    Form is using the popup format of the jotform. from the product page.

    website is 

    http://mysizeclothes.com/lana-leather-jacket/  

    in the Descrition section  MC-Jacket Form

    I added <body onload="javascript:window.opener.childClosed();window.close();"> in  a page and liniked with thankyou page.

    When I hit the submit , it takes me that page. But I wanted the page to be closed and bring back to my products page.  This way it works nice in a mobile phones. Otherwise the back options does not work as intended in mobile. ( iPhone)

    -thx

  • Profile Image
    JotForm Support

    Answered by BJoanna on November 18, 2015 at 04:07 PM

    Thank you for providing us additional information. 

    Yes, you should use that code. You have to create another webpage on your webserver and use that as the Custom URL "Thank You" page for your form.

    In that new webpage you need to have this line of code:

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

    I have submitted your form and I got redirected to your custom Thank you page. After that I have inspected that page, but I did not find mentioned code.

    Where did you added this code?

    Looking forward to your reply.

  • Profile Image

    Answered by mysizeclothes on November 19, 2015 at 07:43 AM

    I will try how to create that page in BC. i used their create page, but by lines did not stick.

    after i saved the lines are gone. 

     

  • Profile Image
    JotForm Support

    Answered by Charlie on November 19, 2015 at 09:03 AM

    Have you contacted BigCommerce to see if adding <script> codes inside the description part of the product listing is allowed? If you are adding scripts then it is being removed after you save the changes, then it is possible that it cannot be added there.

  • Profile Image

    Answered by mysizeclothes on November 20, 2015 at 10:14 AM

    hi i managed to create a page with the specified body

    I have some BC specific head but body looks as it is mentioned.

    can you take a look at it. It is still not closing the popup.

     

  • Profile Image
    JotForm Support

    Answered by Charlie on November 20, 2015 at 11:11 AM

    Could you confirm what you would like to accomplish? If I understand you correct, you want to redirect the user to a different page WHEN the pop-up form is submitted?

    Here's a test page that I made: https://shots.jotform.com/charlie/parent_page.html. See if that's how you want it to work.

    Now this is how I setup mine:

    1. First, I will setup my redirect page. This is my redirect page: https://shots.jotform.com/charlie/redirect_to_parent.html. You can check the page source to see how my code is setup.

    2. First, I will add this script on my <body> tag.

    <body onload="setTimeout(redirectParent, 2000)">

    In that, I'm telling my page that it should run the function redirectParent after 2 seconds.

     

    This is how my redirectParent function is coded:

     <script>

            function redirectParent() {

                window.opener.location.href = 'http://www.google.com' rel="nofollow";

                self.close();

        }

      </script>

    My function says that I will redirect the parent window to www.google.com. After that, close the pop-up window. 

     

    3. Now I add the redirect page to my form's thank you URL.

    See if my test pages works are you expected.

  • Profile Image

    Answered by mysizeclothes on November 20, 2015 at 11:23 AM

    Thx. I tried to close the Form after submit is pressed.

    so that the user will be  back in my product page. Popup the form and after the submit close the popup.

     

  • Profile Image
    JotForm Support

    Answered by BJoanna on November 20, 2015 at 11:43 AM

    I am not sure if your problem is resolved. 

    I tested example of my colleague Charlie and pop up form is closed after submission. Instead of http://www.google.com you need to redirect your users to your products page. 

    Let us know if you need further assistance. 

  • Profile Image

    Answered by mysizeclothes on November 20, 2015 at 11:53 AM

    The issue is the www.google.com in my case is dynamic. It depends on where the user is using the pop-up form.

    they can use from any product page..

     

  • Profile Image
    JotForm Support

    Answered by Charlie on November 20, 2015 at 12:02 PM

    When you say dynamic, you just want to close the window and just open the parent window?

    Example:

    1. User opened this link http://mysizeclothes.com/lana-leather-jacket/ 

    2. He clicks the MC-Jacket Form.

    3. Pop-up window opens

    4. User fills out the pop-up form.

    5. Pop-up form closes automatically.

    6. In the parent page SHOULD it still be http://mysizeclothes.com/lana-leather-jacket/? Or is he redirected on a different page?

     

    Please do elaborate. If you just want to close the pop-up, and remain on the same parent page, then you can remove the line highlighted in blue below on my script code:

    <script>

            function redirectParent() {

                window.opener.location.href = 'http://www.google.com' rel="nofollow" rel="nofollow";

                self.close();

        }

      </script>

     

    I've updated my code, you can test my website page again.

  • Profile Image

    Answered by mysizeclothes on November 20, 2015 at 02:19 PM

    Ok. Yes i just wanted to remain on the same parent page.

    I will try.

    thx

  • Profile Image
    JotForm Support

    Answered by BJoanna on November 20, 2015 at 02:33 PM

    On behalf of my colleague, you are welcome.

    Please let us know if were able to accomplish what you wanted.