Skip to content

Instantly share code, notes, and snippets.

@rutger1140
Created February 20, 2013 10:55
Show Gist options
  • Select an option

  • Save rutger1140/4994751 to your computer and use it in GitHub Desktop.

Select an option

Save rutger1140/4994751 to your computer and use it in GitHub Desktop.
Gravity Forms hook - disable auto scrolling to anchor after submit
// Gravity Forms anchor - disable auto scrolling of forms
add_filter("gform_confirmation_anchor", create_function("","return false;"));
@rutger1140
Copy link
Copy Markdown
Author

@jamesbryant
Copy link
Copy Markdown

Amazing! This was doing my head in. Thanks for sharing.

@jameslem
Copy link
Copy Markdown

it's not working for me right. so bad

@frnhr
Copy link
Copy Markdown

frnhr commented Aug 25, 2013

Works well!!! Woot woot!!!

@cfxd
Copy link
Copy Markdown

cfxd commented Oct 12, 2014

Simpler version:

add_filter('gform_confirmation_anchor', '__return_false');

@advancedsoftwarecanada
Copy link
Copy Markdown

Works GREAT. I put this on first line of /wp-content/plugins/gravityformsquiz/class-gf-quiz.php

// Gravity Forms anchor - disable auto scrolling of forms
add_filter("gform_confirmation_anchor", create_function("","return false;"));

@kenanfallon
Copy link
Copy Markdown

For anyone still finding this gist, you can disable the scrolling to anchor for a single form by entering the form ID. For example for form ID 5, you can use:

add_filter( 'gform_confirmation_anchor_5', '__return_false' );

@thetwopct
Copy link
Copy Markdown

You the man, what a headache :)

@nickmeagher
Copy link
Copy Markdown

Worked great for me, thanks!

@LeMiira
Copy link
Copy Markdown

LeMiira commented Jul 4, 2016

Thanks!

@Garconis
Copy link
Copy Markdown

Thanks @kenanfallon

@dompl
Copy link
Copy Markdown

dompl commented Mar 23, 2017

Thanks @kenanfallon

@nfsarmento
Copy link
Copy Markdown

Thank you @lekkerduidelijk

@tarfoot
Copy link
Copy Markdown

tarfoot commented Jul 31, 2017

Thank you @cfxd and @kenanfallon!

@mohanrangasamy
Copy link
Copy Markdown

Thanks Its working for me

kenanfallon commented on Aug 3, 2015

@ahsanismail942
Copy link
Copy Markdown

Amazing its working perfect thanks

Copy link
Copy Markdown

ghost commented Jun 8, 2019

I'm new to this PHP and have been given a website project. How do I include this code? I've put it between php tags to no avail!

I've done a contact page on a separate php file which is called using the 'include' line and the page sends mail messages but after the submit button is clicked, the page flies up to the top.....

@rutger1140
Copy link
Copy Markdown
Author

I'm new to this PHP and have been given a website project. How do I include this code? I've put it between php tags to no avail!

I've done a contact page on a separate php file which is called using the 'include' line and the page sends mail messages but after the submit button is clicked, the page flies up to the top.....

Put it in your functions.php file and you should be good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment