Zachary Gover Zachary Gover - 2 years ago 65
HTML Question

How to make a PHP Error message popup instead of new page?

Currently on my website I have a form in which once it is submitted, you're taken to a blank screen with the appreciation message.

Instead of moving to a new page, I wish to keep my users on the same page. How might I go about creating a popup and keeping the user within the same page?

Answer Source

You can use javascript validation or HTML5. If you don't want these ways you can just open a popup window and set your form's target to it. Like this :

<form method="post" action="anything.php" onsubmit="'','my_form_target', 'width=300,height=200', true);'my_form_target';" >
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download