Redirect form back to the website it was accessed from

  • info465_info
    Asked on March 28, 2024 at 4:58 PM

    Is there a method of grabbing the URL from the page that directed the user to a form so I can copy that into the Redirect to an external link after submission option so they start on page A, get directed to form and upon submit gets sent back to page A?

  • Mike_G JotForm Support
    Replied on March 28, 2024 at 5:01 PM

    Hi Todd,

    Thanks for reaching out to us for help. I understand the issue, but I’ll need a bit of time to look into this. I’ll get back to you as soon as I can.

    In the meantime, let us know if you have any other questions.

  • info465_info
    Replied on March 30, 2024 at 1:09 AM

    I know there is the get referrer widget but I see no way of using that data in a url redirect or how to enter a url parameter into the redirect. There has to be a way to connect A to B

  • Hilary JotForm Support
    Replied on March 30, 2024 at 1:38 AM

    Hi Todd,

    Thanks for getting back to us. Our colleague is looking into this. She will get back to you once she has any updates.

    Reach out again if you need any other help.

  • Mike_G JotForm Support
    Replied on March 30, 2024 at 3:34 AM

    Hi Todd,

    Thanks for your patience and understanding, we appreciate it. For what you would like to do with your form, we will use the Get Referrer widget to collect the referral URL of the website your form was accessed from. Suppose you already added the Get Referrer widget to your form. We will set your form to redirect to the Get Referrer widget's unique name so your form will redirect back to the website it was accessed from. Let me show you how to set it up:

    1. In Form Builder, select the Get Referrer widget, and click on the Gear icon on the right to open field properties.
    2. Go to the Advanced tab, and scroll down to Field Details.
    3. Expand Field Details and copy the widget's unique name.

      Redirect form back to the website it was accessed from Image 1 Screenshot 50
    4. In the orange navigation bar at the top of the page, click on Settings.
    5. In the menu on the left side of the page, click on Thank You Page.
    6. Now, select Redirect to External Link and paste in the Get Referrer widget's unique name inside of curly brackets. That's it, you're done.

      Redirect form back to the website it was accessed from Image 2 Screenshot 61

    Note: Copy and add the following script on the page where you've embedded or put the link to your form. Place it within the body or the head tags of your HTML page. The script will help get the accurate URL when the form is submitted. 

    <script src="https://app-widgets.jotform.io/scripts/getUrlReferrer.js"></script>

    Redirect form back to the website it was accessed from Image 3 Screenshot 72

    Check out the screencast below to see my result;

    Redirect form back to the website it was accessed from Image 4 Screenshot 83

    You can find my test website here. You might also want to check out these guides:

    Give it a try and let us know if you need any help.

  • info465_info
    Replied on March 30, 2024 at 2:48 PM

    Thank you for this!

    But it’s not working. See attachments for the steps I completed but the form but when I click submit it refreshes the page the form is embedded in and doesn’t go back to the referrer page. The only part I had no idea about was the code on the bottom of your example. You didn’t have any steps or explanation of that code/purpose (see pic with question marks)

    Redirect form back to the website it was accessed from Image 1 Screenshot 70Redirect form back to the website it was accessed from Image 2 Screenshot 81Redirect form back to the website it was accessed from Image 3 Screenshot 92Redirect form back to the website it was accessed from Image 4 Screenshot 103Redirect form back to the website it was accessed from Image 5 Screenshot 114Redirect form back to the website it was accessed from Image 6 Screenshot 125

  • Marehlene_B JotForm Support
    Replied on March 30, 2024 at 2:59 PM

    Hi Todd,

    Thanks for getting back to us. Can you provide the URL of your website, as well as permission to submit a test submission using your form so that we can further investigate this? 

    Once we hear back from you, we'll be able to help you with this.

  • info465_info
    Replied on March 30, 2024 at 3:56 PM

    Please this;

    https://www.canadianbusinessfinancing.com/template

    If it asks for a passcode use; 12341234


    Only click on #3 and the optional onlyas 1 & 2 are using a different method.

    Both #3 and optional setting below in pics

    Redirect form back to the website it was accessed from Image 1 Screenshot 60Redirect form back to the website it was accessed from Image 2 Screenshot 71Redirect form back to the website it was accessed from Image 3 Screenshot 82Redirect form back to the website it was accessed from Image 4 Screenshot 93

    Redirect form back to the website it was accessed from Image 5 Screenshot 104

  • info465_info
    Replied on March 30, 2024 at 4:18 PM

    It appears as if the referer is grabbing the page the form is embedded in and not the original. I think I know why this is happening. I am using a CTA in HubSpot and not a button. Thoughts?

  • info465_info
    Replied on March 30, 2024 at 4:36 PM

    I made another page found here

    https://www.canadianbusinessfinancing.com/template-0

    You can see an extra button at the bottom which is NOT a cta. That doesn’t work either.

  • Girish JotForm Support
    Replied on April 2, 2024 at 3:54 AM

    Hi there,

    Thanks for being patient. From your screenshots, you have set up the codes and unique names correctly for redirection. On the direct form URL without embedding, the redirection works correctly. Could you re-emebd the form on your website using the iFrame code and this time, instead of buttons, please consider using hyperlinks for accessing the forms (as my colleague has shown)? Give it a try and let us know how it goes. If not, we'll escalate to further check.