How to make the page scroll to top on submit?

  • Profile Image
    peturrp
    Asked on April 06, 2019 at 11:21 PM

    2. How can I adjust the Thank you page to open up at to top of my website when the client submit a form – so the client does not have to scroll all the way to top to see the Thank you page?
    Reg.

  • Profile Image
    Jed_C
    Answered on April 06, 2019 at 11:43 PM

    What you need is to embed your form using iframe embed code https://www.jotform.com/help/148-Getting-the-Form-iFrame-Code. Then add the onload="self.scrollTo(0,0)" code in your iframe code.

    Your iframe code should look like this:

    <iframe onload="self.scrollTo(0,0)" id="JotFormIFrame-90844542186361" allowtransparency="true" allowfullscreen="true" allow="geolocation; microphone; camera" src="https://form.jotformeu.com/90844542186361" frameborder="0" style="width: 1px; min-width: 100%; height:539px; border:none;" scrolling="no" > </iframe>


    Kindly try that and see if that helps. Looking forward for your response. 

  • Profile Image
    peturrp
    Answered on April 08, 2019 at 08:43 AM
    Hi there,
    Thank you for this – it works very well.
    Petur
    ...
  • Profile Image
    peturrp
    Answered on April 08, 2019 at 08:43 AM
    Hi again,
    When you click on an image on the order form it opens up in lightbox.
    The image is far below the viewport – how can I adjust that the lighbox image show the image at the top of the lightbox?
    https://epliogco.webflow.io/panta
    Reg.
    Petur

    ...
  • Profile Image
    roneet
    Answered on April 08, 2019 at 10:52 AM

    I have moved your next question to a separate thread:

    https://www.jotform.com/answers/1785790

    Thanks