How to redirect users to another page after they submit the form to my website?

  • Smankovsky
    Asked on June 5, 2019 at 3:48 PM

    Hello,


    I am looking to redirect users to another page after they submit the JotForm on my website, however, on the JotForm settings, the "Submit Form" button is "greyed" out. The last available option to use for the "IF" part of the conditional logic is the signature, but if it redirects after the signature, will all of that information not be submitted and stored?

    Jotform Thread 1847507 Screenshot
  • VincentJay
    Replied on June 5, 2019 at 4:10 PM

    If you just want to redirect your users to your website, please follow these steps:

    1. In the Form Builder, please go to the Settings page.
    2. Select the Thank You Page tab.
    3. Select the Redirect to the external link option.
    4. Add/Type the website link in the box. 

    1559765189zc51 Screenshot 10

    If you want to redirect your users to a different website based on their answer. Please check this guide: https://www.jotform.com/help/317-Change-Thank-You-Page-URL-Based-on-a-Condition

    I hope this helps.

  • Smankovsky
    Replied on June 5, 2019 at 6:59 PM

    Vincent, thanks for your answer.


    However, the form is still not working. I embedded it into a website, and also chose a different URL to redirect the form to after it is completed, but it does not redirect after I submit the form.

    See below:


    1559775518Screen Shot 2019 06 05 at 6 Screenshot 10


    https://streamable.com/9io6m

  • Girish JotForm Support
    Replied on June 5, 2019 at 8:22 PM

    I just did a test submission on your form link and was successfully taken to the link as mentioned by you in the Thank you page settings.

    Have you embedded your Payment form on any webpage? If so, please provide us the webpage URL.

    If you have embedded this form on any website, we would request you to embed the form using the iFrame code and test - https://www.jotform.com/help/148-Getting-the-Form-iFrame-Code.

  • Smankovsky
    Replied on June 5, 2019 at 8:46 PM

    Yes, it works on the link you just shared, but I am trying to embed it on my site. I just used the iFrame code and tested it on the site, and the same result happens as the one that I showed in the video I posted earlier (removed the payment integration part so I can test it). Here's the code:

     


    <iframe id="JotFormIFrame-71788764680170" title="PAYMENT FORM" onDISABLEDload="window.parent.scrollTo(0,0)" allowtransparency="true" allowfullscreen="true" allow="geolocation; microphone; camera" src="https://form.jotform.com/71788764680170" frameborder="0" style="width: 1px; min-width: 100%; height:1149px; border:none;" scrolling="no" > </iframe> <script type="text/javascript"> var ifr = document.getElementById("JotFormIFrame-71788764680170"); if(window.location.href && window.location.href.indexOf("?") > -1) { var get = window.location.href.substr(window.location.href.indexOf("?") + 1); if(ifr && get.length > 0) { var src = ifr.src; src = src.indexOf("?") > -1 ? src + "&" + get : src + "?" + get; ifr.src = src; } } window.handleIFrameMessage = function(e) { if (typeof e.data === 'object') { return; } var args = e.data.split(":"); if (args.length > 2) { iframe = document.getElementById("JotFormIFrame-" + args[(args.length - 1)]); } else { iframe = document.getElementById("JotFormIFrame"); } if (!iframe) { return; } switch (args[0]) { case "scrollIntoView": iframe.scrollIntoView(); break; case "setHeight": iframe.style.height = args[1] + "px"; break; case "collapseErrorPage": if (iframe.clientHeight > window.innerHeight) { iframe.style.height = window.innerHeight + "px"; } break; case "reloadPage": window.location.reload(); break; case "loadScript": var src = args[1]; if (args.length > 3) { src = args[1] + ':' + args[2]; } var script = document.createElement('script'); script.src = src; script.type = 'text/javascript'; document.body.appendChild(script); break; case "exitFullscreen": if (window.document.exitFullscreen) window.document.exitFullscreen(); else if (window.document.mozCancelFullScreen) window.document.mozCancelFullScreen(); else if (window.document.mozCancelFullscreen) window.document.mozCancelFullScreen(); else if (window.document.webkitExitFullscreen) window.document.webkitExitFullscreen(); else if (window.document.msExitFullscreen) window.document.msExitFullscreen(); break; } var isJotForm = (e.origin.indexOf("jotform") > -1) ? true : false; if(isJotForm && "contentWindow" in iframe && "postMessage" in iframe.contentWindow) { var urls = {"docurl":encodeURIComponent(document.URL),"referrer":encodeURIComponent(document.referrer)}; iframe.contentWindow.postMessage(JSON.stringify({"type":"urls","value":urls}), "*"); } }; if (window.addEventListener) { window.addEventListener("message", handleIFrameMessage, false); } else if (window.attachEvent) { window.attachEvent("onmessage", handleIFrameMessage); } </script>


     

  • Girish JotForm Support
    Replied on June 5, 2019 at 10:05 PM

    Please remove the script part and add only the iframe section into your website and check if it's working.

    15597866890606 13 Screenshot 10

  • Smankovsky
    Replied on June 6, 2019 at 9:18 AM

    Gerard, thanks for clarifying that. Just tried that, still getting the same result. It does not redirect, the screen goes blank, but you can still see that the form is "there" because you can scroll within the form. See what I am talking about here: https://streamable.com/grtaj



    Thanks

  • David JotForm Support Manager
    Replied on June 6, 2019 at 10:49 AM

    You may grab the form's URL: https://www.jotform.com/help/401-Where-to-Find-My-Form-URL

    And embed it through the Website Address option:

    1559832314websiteaddress Screenshot 10

    Let us know if that helps.


  • Smankovsky
    Replied on June 6, 2019 at 11:45 AM

    That was the first thing I tried before embedding the code :(

  • Smankovsky
    Replied on June 6, 2019 at 11:49 AM

    Just tried it again, still nothing @BDDAVID

     

    And if you look on JotForm, the submissions are registering, it is just not redirecting.

  • Nik_C
    Replied on June 6, 2019 at 1:30 PM

    The issue seems to be related to a set of restrictions for the content in iFrame, which is the base of the Wix HTML element. You can find some more information in this thread.

    Also, you could probably contact Wix support to see if they have a solution to this issue.

    Thank you.

  • Smankovsky
    Replied on June 6, 2019 at 5:27 PM

    No help from Wix:


    1559856408Screen Shot 2019 06 06 at 3 Screenshot 10


    1559856445Screen Shot 2019 06 06 at 5 Screenshot 21


  • David JotForm Support Manager
    Replied on June 6, 2019 at 5:39 PM

    Instead of using the HTML Iframe option, please use the Embed a Site option?

    1559857095embedsiste Screenshot 10

    That is the recommend method as described in this guide: https://www.jotform.com/help/70-Adding-a-Form-to-Your-Wix-Site

    Let us know if that helps.

  • Smankovsky
    Replied on June 7, 2019 at 10:37 AM

    @BDAVID, as mentioned above, this was the first method that was tried. It does not work either.


    The forms are submitting. If I change the success option from redirect URL to a Thank You Page, the Thank You Page appears, and the data gets sent to JotForm. It is not redirecting after submission.

  • BJoanna
    Replied on June 7, 2019 at 12:27 PM

    Sorry for the inconvenience this may have caused you. 

    I tested your embedded form and I was able to replicate the issue you reported. 

    Before you removed the PayPal payment field was the page blank as well?

    I searched on our forum for similar issues and I found that this issue is most likely related to Wix restrictions on embedded content. From what I found the issue is related to the 'sandbox' restrictions on the Wix side. An 'allow-top-navigation' attribute value is missing and embedded form does not have proper permissions to perform the redirect.

    1559924610sandbox Screenshot 10

    Can you please check with Wix if the sandbox attribute on your Wix site can be removed completely, or changed to give all required permissions? 

    You can find additional info on this thread - https://www.jotform.com/answers/829758

  • Smankovsky
    Replied on June 7, 2019 at 2:56 PM

    There was never a PayPal payment field, there was a credit card field set up through a merchant, but I removed it so that I can test the redirect

  • Nik_C
    Replied on June 7, 2019 at 3:19 PM

    I'm afraid that we run out of options, since the issue is out of our scope.

    As a workaround, you could place the link in the thank you page and just show it to the user, if you need to add different links, you can use conditional logic to show different Thank you pages: https://www.jotform.com/help/317-Change-Thank-You-Page-URL-Based-on-a-Condition

    Hope it helps.