How to scroll to invalid field on submit?

After I hit the submit button on my forms, if there is an invalid field, I would like the page to focus on it and scroll up to its position.

I’ve seen suggestions, on here or stackoverflow, but when I tried the suggested method (not confirmed to work on Umbraco by the way), the code in the invalidHandler part is never hit. Is there something else in Forms that override that call maybe?

Any other suggestion on how to do something similar?

I’m running Umbraco 7.5.13 with Forms 4.4.2.


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/87935-how-to-scroll-to-invalid-field-on-submit