Forcing Users to Fill in All Fields in a Form
Posted: Wed Dec 21, 2005 11:54 am
If a user leaves a field blank in my php form, they are getting an error message after the click SUBMIT.
What do I need to add to my code so that they are forced to fill in all fields?
Here's my current code:
THANKS FOR YOUR HELP!
What do I need to add to my code so that they are forced to fill in all fields?
Here's my current code:
Code: Select all
<?php
$avail = '';
foreach ($availability as $val)
$avail .= $val.", ";
$tech = ''; foreach ($techSkills as $val)
$tech .= $val.", ";
$act = '';
foreach ($activities as $val)
$act .= $val.", ";
$formsent = mail("email@email.org", "Volunteer Form: $name", "Name: $name\r\n\r\nJob email: $email\r\n\r\nPhone: $phone\r\n\r\nAdress: $address\r\n\r\ncity: $city\r\n\r\nstate: $state\r\n\r\nZipCode: $zipCode\r\n\r\nbirthdate: $birthmonth $birthdate $birthyear\r\n\r\nCollege or Certificates: $college\r\n\r\nnative Tongue: $language\r\n\r\nOther Languages: $addlLanguages\r\n\r\nTimes Available: $avail\r\n\r\nHow Often: $howOften\r\n\r\nSpecialities: $skills\r\n\r\nSkills: $tech\r\n\r\nExperience: $youngLearners\r\n\r\nWilling to Participate in: $act\r\n\r\nHow Did You Hear ABout Us?: $hearAbout\r\n\r\nDo you have a car? $car\r\n\r\nType of Agent: $agent");
header("Location:http://www.website.com");
?>THANKS FOR YOUR HELP!