Form jumps down when clicking on next button

  • rvselect1234
    Asked on June 22, 2016 at 6:10 PM

    When someone is completing our form and selects 'Next' the next section jumps down and skips the top line, almost as if it is bookmarked. Any idea what could be causing the issue?

     

    Form - http://www.rvselectinc.com/rv-description/

  • jonathan
    Replied on June 22, 2016 at 10:08 PM

    I was able to see the issue as well when I test the form on your website

    I think it has to do with script conflict that is happening on the page between the form scripts and those existing on your website.

    Form jumps down when clicking on next button Image 1 Screenshot 20

    To fix, please try removing first the publish form in your website. And then re-publish it using instead its iframe publish code.

    User guide: Getting-the-form-iFrame-code

    You can test again after publishing the form. See if the jumping behavious still happens.

    Let us know if this did not resolve the issue.

  • rvselect1234
    Replied on June 24, 2016 at 4:12 PM

    I've updated the code on the page http://www.rvselectinc.com/rv-description/ to the iframe version and it still seems to be jumping.

  • Kiran Support Team Lead
    Replied on June 24, 2016 at 5:18 PM

    Please try embedding the form using the following embed code.

    <iframe

    id="JotFormIFrame"

    onDISABLEDload="window.parent.scrollTo(0,0)"

    allowtransparency="true"

    src="https://form.jotform.com/42304323515140"

    frameborder="0"

    style="width:100%;

    height:539px;

    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 "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);

    }

    if(window.location.href && window.location.href.indexOf("?") > -1) {

    var ifr = document.getElementById("JotFormIFrame");

    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;

    }

    }

    </script>

    Let us know if the issue still persists. We will be happy to assist you further.

     

  • rvselect1234
    Replied on June 24, 2016 at 8:01 PM

    That seems to work. Thank you!

  • rvselect1234
    Replied on June 28, 2016 at 1:50 PM

    Actually using this code caused the 'submit form' to become unviewable on my mobile site (which we only just noticed!). Any other solutions?

  • Kiran Support Team Lead
    Replied on June 28, 2016 at 2:06 PM

    I have checked the web page on a mobile emulator and it seems to be working fine. Please see the screenshot below:

    Form jumps down when clicking on next button Image 1 Screenshot 20

    Which mobile phone you are experiencing the issue with to see if we can replicate the issue at our end?

  • rvselect1234
    Replied on June 29, 2016 at 8:04 PM

    I went in and fixed it immediately by using the iFrame code instead, so it works again. But now the issue of the form jumping is back.

  • Kiran Support Team Lead
    Replied on June 29, 2016 at 9:35 PM

    Could you try replacing the form URL with https://form.jotform.com/42304323515140?nojump in the iframe embed code and see if that works?