Bruce Gust
asked on
How can I use an alert box that allows user to either continue or kill the form submission?
Here's my PHP:
$amber = "select id from students where first_name='$first_name' and last_name='$last_name'";
$amber_query=mysqli_query($cxn, $amber)
or die("Amber didn't make it.");
$amber_count=mysqli_num_rows($amber_query);
if($amber_count>0)
{
//you've got someone with the same first and last name, check to see if the family_id select box was utilitzed
if(isset($_POST['family_id'])&&trim($_POST['family_id'])<>"")
//they chose a last name, so that means they're getting ready to duplicate somebody
{
header("Location:student_duplicate.php");
exit();
}
RIGHT HERE - I want to put a Javascript alert box that tells the user they're getting ready to potentially add a duplicate entry. It may not be, so I want to give the user to either continue with the submission, or kill it. How?
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think you'll get better results faster that way!
ASKER
The problem is that the alert, while it would normally be cut and dry, has to have the ability to communicate with the server like you pointed out. Hence, I'm going to punt this approach and go with something else.
Thanks!