any way to put form errors in a modal?

when you don't fill out a required field on the registration form you get an error (see screenshot). The problem is my registration from collapses so when the error happens you don't see it. The collapse form closes and you have to re open it to see the error. Any way to put the errors in a modal (or whatever) that disappears after a few seconds?