Thank you page not showing in embedded form. Page scrolls to top.

  • Profile Image
    jilllauret
    Asked on September 08, 2017 at 06:20 AM

    Hi!

    My thank you page for reservations is on a one page website. When I confirm the reservation, the screen goes to top of the website and the 'thank you message' cannot be seen on screen.

    It does when I scroll down, but I would like it to been seen on the samen place as the reservation form.

    What can I do about that?

     

    Thanks!

     

  • Profile Image
    Jan
    Answered on September 08, 2017 at 10:00 AM

    My understanding is that after hitting the Submit button, then webpage scrolls to the top of the website.

    Please try to re-embed the form using the iFrame method. Here's a guide: https://www.jotform.com/help/148-Getting-the-Form-iFrame-Code. Here's an example:

    <iframe id="JotFormIFrame-72493622547967" onload="window.parent.scrollTo(0,0)" allowtransparency="true" src="https://form.jotformpro.com/72493622547967" frameborder="0" style="width: 1px; min-width: 100%; height:539px; border:none;" scrolling="no"></iframe> <script>...</script>

     

    If the issue is still the same, please try changing the "onload" attribute of the iFrame code to "self.parent.scrollTo(0,0)".

    <iframe id="JotFormIFrame-40062521395347" onload="self.parent.scrollTo(0,0)" allowtransparency="true" src="https://form.jotformpro.com/40062521395347" frameborder="0" style="width: 1px; min-width: 100%; height:539px; border:none;" scrolling="no"></iframe>
    <script>...</script>

     

    Hope that helps. Let us know if the issue is still the same. Thank you.

  • Profile Image
    jilllauret
    Answered on September 19, 2017 at 05:09 AM

    Hello!

    I've tried your solutions, but the problem still exists: after hitting the Submit button, the webpage scrolls to the top of the website.

    Any other ideas to solve this?

    http://qpasa.nl/quepasa_veldhoven/

  • Profile Image
    ashwin_d
    Answered on September 19, 2017 at 05:48 AM

    I did test your embedded form and I am able to replicate the issue you are having. I would suggest you to please embed your form using its iFrame embed code and see if that solves your problem:

    <iframe id="JotFormIFrame-40062521395347" onload="self.parent.scrollTo(0,0)" allowtransparency="true" src="https://form.jotformeu.com/40062521395347?nojump" frameborder="0" style="width: 1px; min-width: 100%; height:650px; border:none;" scrolling="no"> </iframe>

    <script type="text/javascript"> var ifr = document.getElementById("JotFormIFrame-40062521395347"); 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) { var args = e.data.split(":"); if (args.length > 2) { iframe = document.getElementById("JotFormIFrame-" + args[2]); } 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; } 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>


    If the issue persists, I would suggest you to please setup a custom thank you URL in your form. You need to basically create a custom thank you page in your website and use it in your form as custom thank you URL. The following guide should help you:  http://www.jotform.com/help/38-Redirecting-Users-to-a-Different-Page 

    Hope this helps.

    Do try it out and get back to us if you have any questions.