Display a "Please wait" message after submitting forms?

I have a form that allows users to submit up to 6 images that become part of a custom post type. When they submit the form, it can take a while (depending on the quantity and size of images) for the form submission to complete and the confirmation page to display.

Is there a way to show a spinning beach ball or similar GIF with a “please wait” message until the form submission is successful and the confirmation page is displayed?

There are a couple filters that allow you to control the spinner when processing a form action. You could potentially use this in combination with some custom CSS to overlay the image on the current page in a more modal fashion. Not sure how you might display text as part of that though, unless maybe it’s baked into the image.

None of these filters are working. Do you have another example I can try? I’m noticing people are leaving before the form is submitted, its taking long. I want to display “please wait” or something like that.