If a user is a small screen device, there are many situations where they will never see an error message.
I referred this link
Usability issues with error/notice/success messages. But do not get any answer
For example,
- if they're on the "Shipping" step of the checkout process and an
error message is added, they may not see the error message get added
to the top of the page. - My suggestion would be to either smooth scroll the user up to the
error message, display the error message next to the button.
Best Answer
A possible quick solution could be using high-level programming languages like Javascript.
Just check if the error div has value in it using selector in jQuery/Javascript, and then add a jQuery script to scroll to top:
You could also add smooth effect if you wish to.