Intergrating JavaScript and PHP?
Posted: Sat Dec 10, 2005 3:46 pm
Hello,
Suppose I have this forum validation:
And instead of the echo statements, I want to have JavaScrtipt's alert() function to pop up a box that says the warning, but every warning generated from the arrays would be in one alert box
How would I go about doing this?
Suppose I have this forum validation:
Code: Select all
if(isset($_POST['submitted'])){
if (!empty($_POST['lname'])){
$lname=trim($_POST['lname']);
}else{
error[]="Please enter your lastname";
}
if (!empty($_POST['rank'])){
$rank=$_POST['rank'];
}else{
error[]="-Please select your rank";
}
if (!empty($_POST['email'])){
$e=trim($_POST['email']);
}else{
error[]="-Please enter your email";
}
if (!empty($_POST['xfire'])){
$xfire=trim($_POST['xfire']);
}else{
error[]=-Please enter your Xfire ID";
}
if (!empty($_POST['squad'])){
$squad=$_POST['squad'];
}else{
error[]="-Please select your squad";
}How would I go about doing this?