Thanks to this forum I was able to figure out how to see if someone has checked a check box. I am trying to force visitors to my website to select atleast one check box from a detail page. Here is what I currently have but it is not working, even if no bids are submitted from the previous page it allows the visitor to progress. The $num_dates_bid variable is functioning and is properly showing the # of dates selected.
Thank you in advance for your time.
<script language="php">
// in: $id, $jobdatetime[];
// Count the number of dates bid
$num_dates_bid = count($_POST['jobdatetime']);
echo "You clicked $num_dates_bid dates to bid on.";
// If # of dates bid is 0 then display error, else go on
if ($num_dates_bid = 0) {
echo "Please go back and select atleast one date to bid on.";
} else {
$forminfo = "<input type=\"hidden\" name=\"id\" value=\"$id\">";
$num_dates = sizeof($jobdatetime);
if($num_dates < 1) { $num_dates = 1; }
for($cnt = 0; $cnt < $num_dates; $cnt++) {
$jobdatetime[$cnt] = htmlspecialchars($jobdatetime[$cnt]);
$forminfo .= "<input type=\"hidden\" name=\"jobdatetime[]\" size=\"20\" value=\"" . $jobdatetime[$cnt] . "\">";
}
}
</script>
<font size="5" color="#0000dd">Please verify that you Agree with the following information:</font>
<hr>
<?php include($unix_root . 'doclogin_terms/body.php3'); ?>
<form action="./" method="POST">
<input type="hidden" name="page" value="job_bid">
<input type="hidden" name="sub" value="verify_bona">
<input type="hidden" name="layout" value="plain">
<?php echo $forminfo; ?>
<input type="submit" value="I Agree">
</form>
<form action="./" method="POST">
<input type="hidden" name="page" value="welcome">
<input type="submit" value="I Do Not Agree">
</form>