This is checking to see if at least one of the checkboxes on the form was checked:
$checked = "no";
if (isset($_POST['employment_chkbox'])) {
$checked = "yes";
}
if (isset($_POST['business_chkbox'])) {
$checked = "yes";
}
if (isset($_POST['certification_chkbox'])) {
$checked = "yes";
}
if (isset($_POST['youth_chkbox'])) {
$checked = "yes";
}
if (isset($_POST['parent_chkbox'])) {
$checked = "yes";
}
if (isset($_POST['advocacy_chkbox'])) {
$checked = "yes";
}
if ($checked == "no")
{
echo "Please use your browser to go back and select at least one program.";
}
And that DOES NOT work.
Here is me trying to see if any of these required fields were not filled out... and if they were not, adding them to a message that will be echoed and the user will be able to press back and fix it...
$error = "You need to go back and fill in these fields:<br>"
if ($firstname == '') {
$error = "$error. <br>first name"; /
}
if ($lastname == '') {
$error = "$error. <br>last name" ; //and so on and so on
}
if ($month == '') {
$error = "$error. <br>month of birth" ;
}
if ($day == '') {
$error = "$error. <br>day of birth";
}
if ($year == '') {
$error = "$error. <br>year of birth" ;
}
if ($street == '') {
$error = "$error. <br>street";
}
if ($city == '') {
$error = "$error. <br>city";
}
if ($state == '') {
$error = "$error. <br>state";
}
if ($postalcode == '') {
$error = "$error. <br>zip code";
}
if ($homephone == '') {
$error = "$error. <br>home phone";
}
if ($referral == '') {
$error = "$error. <br>referral";
}
if ($contact == '') {
$error = "$error. <br>best time to contact";
}
if ($race = '') {
$error = "$error. <br>race" ;
}
if ($gender == '') {
$error = "$error. <br>gender" ;
}
echo $error;
This doesnt work either. This is going on two days now I have been trying to get this to work.
Thanks for your help... I REALLY appreciate it.