I have a contact form on contactpage1.php (department, name, email, message). When it is submitted the form 'action' is contactpage2.php which validates the data and either return error messages or emails the message.
Rather than having to go to contactpage2.php, I would prefer to keep everything on one page and have contactpage2.php open in a modal.
How would I do that?
So far, I've seen lots of example of clicking a button to open a modal with the contact form but that's not what I am after. Can I do it as described above?
I'm using Bootstrap modals elsewhere on the site.