please help me for this web masters out there

my problem is:

i have a that pulls out information from the database

$query=mysql_query("select * from requirements)


echo "<form name='requirements' action='checkrequirements.php' method='post'>";
while ($requirements=mysql_fetch_array($query)){
echo "<input type='checkbox' name='$result[$rnum]'>" . $result . "";

echo "<input type='submit' value='Enroll'>";
echo "</form>";

before submitting this form to the next page, i want to validate first if all the check boxes are checked.. if not, there would be a prompt that says that all requirements must be checked..

please help me..

i don't know where to start..

i want to thank you...

in advance.. thanks..

change your line to:

echo "<input type='checkbox' name='results'>" . $result . "";

and then validate like this :

var total=0;
for(var i=0; i < document.form1.results.length; i++){
total =total+1;
alert("Please select all")