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.

Need to anchor down to submitted form to see messages

  1. I have a small one page site I'm finalizing which has a contact us form at the bottom of the page.

    When a user submits the form the page is reloaded and only the top of the page is in view instead of the form at the bottom, so users won't be able to see error messages or the success message.

    Is there a way to pass an anchor tag on the submit so the page will scroll down to #contact?

    Example is posted here:
    http://clients.freelancewebdesigner.com/jw/20110224-nchp/

    Thanks,
    DAN

    Posted 13 years ago on Thursday February 24, 2011 | Permalink
  2. You have 2 options here.

    One is to turn on AJAX for that form. It automatically anchors to the form if there is an error. If the version of Gravity Forms you are using does not support AJAX (it will be an option when using the Insert Form wizard, it's ajax=true in the shortcode) then I suggest you upgrade to the latest release. You can run the new 1.5 development release also if you want, it's available on the Downloads page and stable.

    Your other option is if you don't want to use AJAX you can add a line of code to your themes functions.php that will tell Gravity Forms to anchor to the form when there is an error.

    This is the code you would add to your themes functions.php file:

    <?php
    add_filter("gform_confirmation_anchor", create_function("","return true;"));
    ?>
    Posted 13 years ago on Thursday February 24, 2011 | Permalink
  3. Thanks! Got it working. I edited the functions.php and now it works perfectly.

    Posted 13 years ago on Friday February 25, 2011 | Permalink

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