Multi-page form on SquareSpace not returning to top

  • mvcchurch
    Asked on May 2, 2015 at 1:30 PM

    We have a multi page registration form at

    http://www.mvcchurch.org/vbs/register

    It is embedded using an iFrame.  When the user advanced to the next page the page does not scroll to the top of the form, which may confuse users.  Can you please help us with any options available to correct this?

    I saw this thread, which looks like the same issue:

    http://www.jotform.com/answers/544459-Multipage-Form-Embedded-by-iFrame-does-not-scroll-up-to-top-when-clicking-next-and-back-button

    Thanks,

     

    Brian

     

  • raul
    Replied on May 2, 2015 at 5:57 PM

    Please try to include the script portion (highlighted in yellow) of the iframe code in your site.

    <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;case "collapseErrorPage":if (iframe.clientHeight > window.innerHeight) {iframe.style.height = window.innerHeight + "px";}break;case "reloadPage":window.location.reload();break;}};if (window.addEventListener) {window.addEventListener("message", handleIFrameMessage, false);} else if (window.attachEvent) {window.attachEvent("onmessage", handleIFrameMessage);}</script>

    It's possible now to embed custom scripts in Squarespace, so you would need to save the script above in a .js file and then include it on your site like this:

    <squarespace:script src="file_name.js" combo="true" />

    Please give it a try and let us know if this helps.