Submit form can't reset to top of page.

  • Profile Image
    scottdever
    Asked on May 01, 2014 at 09:21 AM

    Hello, I have read another thread on this and after following the suggestion still cannot make this work.  The problem is that my form is long and when the user hits the submit button the thank you message is displayed but cannot be seen without the user scrolling to the top of the page manually.

    below is the iframe i have in my page:

    <iframe id="JotFormIFrame" onload="window.parent.scrollTo(0,0)" allowtransparency="true" src="//form.jotform.us/form/41113639376152" frameborder="0" style="width:100%; height:1317px; border:none;" scrolling="no"></iframe>
    <script type="text/javascript">window.handleIFrameMessage = function(e) {var args = e.data.split(":");var iframe = document.getElementById("JotFormIFrame");if (!iframe)return;switch (args[0]) {case "scrollIntoView":iframe.scrollIntoView();break;case "setHeight":iframe.style.height = args[1] + "px";break;}};if (window.addEventListener) {window.addEventListener("message", handleIFrameMessage, false);} else if (window.attachEvent) {window.attachEvent("onmessage", handleIFrameMessage);}</script>

    Please let me know what I can do, thanks!

  • Profile Image
    ashwin_d
    Answered on May 01, 2014 at 10:36 AM

    Hello scottdever,

    I would suggest you to please exclude the script code and see if that helps you solve your problem. Please use only the following embed code:

    <iframe id="JotFormIFrame" onload="window.parent.scrollTo(0,0)" allowtransparency="true" src="//form.jotform.us/form/41113639376152" frameborder="0" style="width:100%; height:1317px; border:none;" scrolling="no"></iframe>

    or you can also try to remove the onload="window.parent.scrollTo(0,0)" from the above iFrame code and see that helps you. Here is the code:

    <iframe id="JotFormIFrame" allowtransparency="true" src="//form.jotform.us/form/41113639376152" frameborder="0" style="width:100%; height:1317px; border:none;" scrolling="no"></iframe>

    Do try both the options and get back to us if the issue persists.

    Thank you!