this code have no problem, but i dont want it to show in the upper part of the form,
i want it to show as alertbox, but showing all the message that are empty not one by one.
Example:
alertbox
You are required to complete the following fields: First name, Contact no., Job title, First guess.
Thank you.
$problem = FALSE; //no problem
//check value
$themessage = "You are required to complete the following fields: ";
if (empty($fguess)){
$problem = TRUE;
print '<br/>Pls. enter a valid First guess';
}
if (empty($sguess)){
$problem = TRUE;
print '<br/>Pls. enter a valid Second guess';
}
if (empty($tguess)){
$problem = TRUE;
print '<br/>Pls. enter a valid Third guess';
}
if (empty($_POST['f_name'])){
$problem = TRUE;
print '<br/>Pls. enter your First name';
}
if (empty($m_name)){
$problem = TRUE;
print '<br/>Pls. enter your Middle name';
}
if (empty($l_name)){
$problem = TRUE;
print '<br/>Pls. enter your Last name';
}
if (empty($h_address)){
$problem = TRUE;
print '<br/>Pls. enter your Home address';
}
if (empty($email)){
$problem = TRUE;
print '<br/>Pls. enter your Email Address';
}
if (empty($contact)){
$problem = TRUE;
print '<br/>Pls. enter your Contact no.';
}
if (empty($job)){
$problem = TRUE;
print '<br/>Pls. enter your Job title';
}


Sign In
Create Account

This topic is locked

Back to top









