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?
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.
That worked great. I had to add some CSS to compensate for the fixed header so the validation message isn’t hidden, then perfect!
If you want to make your validation errors even friendly (especially on mobile), you can scroll to the specific field that failed validation.