Two forms on page - validation error scrolls to top [RESOLVED]

I have two forms on one page, one at the top of the page, one at the bottom. I’m using two different forms so they work and don’t get confused. If there’s a validation error on the bottom form (such as blank required field), when it’s submitted the page scrolls to the top of the page rather than to the top of the bottom form.

How can I fix this?

Thanks!
Mad Dog

You can use the gform_confirmation_anchor filter for that. Despite the name, the filter runs when the page is reloaded with a validation error as well.

1 Like

Thanks again!

That worked great. I had to add some CSS to compensate for the fixed header so the validation message isn’t hidden, then perfect!

1 Like

If you want to make your validation errors even friendly (especially on mobile), you can scroll to the specific field that failed validation.

https://gravitywiz.com/make-gravity-forms-validation-errors-mobile-friendlyer/

2 Likes