My JSP page includes a form with a div that displays error messages when validation fails. The errors are generated server-side, displayed inside the div using struts property tag.
However, the issue I'm facing is that the submit button is located far below the form, while the error div is at the top. This means that when an error occurs, users need to scroll back up to see the error message.
I'm looking for a solution where the page automatically scrolls up to highlight the error message when it occurs. I'm open to using jQuery or CSS solutions. Any help would be appreciated. Thank you.