PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Scroll to top of page (or maintain position) on form subbmission

  1. Howdy folks! On submission, in Safari at least, the page is resetting with the confirmation at the top of the page. The result is a bit awkward. On submission, I'd like the browser to either stay where it is (do nothing) or scroll to the top. I tried the following:

    <script type="text/javascript">
    
    jQuery(document).bind('gform_confirmation_loaded', function(){
        jQuery(window).scrollTop();
    });
    
    </script>

    No success yet. Any ideas?

    Posted 13 years ago on Monday April 25, 2011 | Permalink
  2. When you use the AJAX option on the shortcode it will do this automatically. When not using AJAX you can tell Gravity Forms to do this using the gform_confirmation_anchor filter. You can find documentation for this here:

    http://www.gravityhelp.com/documentation/page/Gform_confirmation_anchor

    Posted 13 years ago on Monday April 25, 2011 | Permalink
  3. I commented out the references to scrollTop in form_display.php, on lines 482 and 492. That accomplished what I was after, but it's obviously not upgrade proof.

    My goal is for the browser to do nothing on my small form. On a large form, I see scrollTop being particularly useful. I have an email input form on the sidebar, hardcoded into the template via the gravity_form function and AJAX is enabled.

    Posted 13 years ago on Tuesday May 3, 2011 | Permalink

This topic has been resolved and has been closed to new replies.