Scroll to top on forms



I have a form with various components and I show the errors in top of page (the page is to long).
I want when the user clicks the submit button and there is errors go to the top of the page (for he/she can see the errors). How I can do that?