I am working on a project that currently works, but I think it could work better. I have a tab for built for a contact form, the form performs all validation on the fly, and even has reCaptcha to prevent spambots. What I'd like to work on is instead of the current setup where someone clicks the submit button, it takes them to the form processor, which then redirects them back to the home page(which is my entire site. The entire site is one page). Anyways, if someone fails the captcha challenge, they can go back, but it takes them back to the default tab(not the contact form tab) and it also resets the contact form so the user has to re-enter everything.
What I would like to do instead is when the user presses the submit button, I'd like it to show a window that overlays the page with the results of the form and the option to continue submitting the form (or cancel and return to edit the information). Or if the user fails the captcha challenge, it lets the user know and offers them the chance to try again or cancel. I know the ability to do this lies somewhere in my contactprocessor.php, but this is a little out of my reach as far as skill goes. If someone can point me to an excellent resource or if anyone would like to offer a better (perhaps simpler solution) I'm all for it.
I've provided the code for my contactprocessor.php for anyone that wants to take a look: