Hi , here is the code......here i am getting some values from the database and displaying it
with an checkbox as given below,,,,i want to validate those checkboxes,,,,,whether the user is selected or not , as soon he clicks the submitt button......and here here the values are comming from different table based on user request, so as soon as those values displays with an checkbox i want to validate.....i have given same name for all checkbox as u can see........just help me out.......
<?php
include('database.php');
$stype=$_POST['category'];
if($stype=="service_category")
{
$result = mysql_query("SELECT * FROM service_category ");
while($row = mysql_fetch_array($result))
{
?> <input type="Checkbox" name="contype[]" value="A">
<?
echo $row['servicec'];
echo "<br />";
}
}
else if($stype=="servicetype")
{
$result = mysql_query("SELECT * FROM service_type ");
while($row = mysql_fetch_array($result))
{
?><input type="Checkbox" name="contype[]" value="B"> <?echo $row['servicet'];
echo "<br />";
}
}
else
{
$result = mysql_query("SELECT * FROM services ");
while($row = mysql_fetch_array($result))
{
?><input type="Checkbox" name="contype[]" value="C"> <?echo $row['servicess'];
echo "<br />";
}
}
mysql_close();
?>