Iframe - scroll to top of page

  • art_crate
    Asked on July 3, 2015 at 11:29 PM

    When using a iframe to display the form, is there anyway to use html to get the page to scroll to the top when you are going through a multi page survey?

     

    I have tried this with no success:

     <body onDISABLEDload="location.href='#top'">

     

  • Boris
    Replied on July 4, 2015 at 1:37 AM

    The form should scroll to the top automatically when using a multi-page form, and clicking on Next. If this is not the case in your website, would you please be so kind to provide an URL to the exact page where you have embedded your form, so that we can take a look.

    Thank you.

  • art_crate
    Replied on July 4, 2015 at 1:40 AM

    http://www.artcrate.co/home-decor-style-1-1

     

    Its very noticeable when viewing on a mobile device

    Thanks for the help!

  • Boris
    Replied on July 4, 2015 at 2:01 AM

    Oh, now I see what you were talking about, and I apologize for the confusion. The form will scroll to the top of its own page (the top of the form), but it does not scroll to the top of your own website.

    This is by design of how iFrames work in general, and I'm afraid that we do not have a workaround for it on our end. It was a conscientious decision by the creators of web and iFrames that goes far back, and has valid reasoning behind it.

    As the iFrame is a page on its own inside your website, sandboxed from the rest of your website, it doesn't see around it. The iFrame doesn't know how far down on the real page it is, so it couldn't know if it is OK to jump to the top of the website page. As you are interacting with the iFrame - such as opening other URLs inside the frame - the iFrame will always jump into focus with the top of the affected iFrame being at the top of your screen.

    I hope this explanation was helpful, and I apologize for not having a solution that you desire. I hope you understand that this behavior is not something that is mandated by JotForm, but rather a feature of web in general.