Checkbox validate
Dear colleagues,
Am working on a beginners project and I have problems with my checkboxes. These checkboxes are an array and I need to validate them.
- Students are supposed to choose 2 courses per week.
- However Financial Management is taught for a whole week hence if a student chooses this course in week 1, they are NOT allowed to choose another course in that particular week.
- If a student chooses Financial Management in week 1, they MUST choose it again in week 2.
How do I validate these?
_________________________
The code for the table looks like:
____________________
<html>
<head>
</head>
<body>
<form method="POST" action="insert.php">
<table border="0" width="500" id="table1" cellspacing="0" cellpadding="0">
<tr>
<td width="397"><b>Course Name</b></td>
<td width="103"><strong>
Select</strong></td>
</tr>
<tr>
<td width="500" bgcolor="#C0C0C0" colspan="2"><b>WEEK1</b></td>
</tr>
<tr>
<td width="397"><span style="font-size: 11px">
Financial Management</span></td>
<td width="103">
<input type="checkbox" name="chkCourse[]" value="Financial Management"></td>
</tr>
<tr>
<td width="397"><span style="font-size: 11px">
Product Marketing
</span></td>
<td width="103">
<input type="checkbox" name="chkCourse[]" value="Product Marketing"></td>
</tr>
<tr>
<td width="397"><span style="font-size: 11px">
Loan
Portfolio Audit Toolkit</span></td>
<td width="103">
<input type="checkbox" name="chkCourse[]" value=" Loan Portfolio Audit Toolkit"></td>
</tr>
<tr>
<td width="397"><span style="font-size: 11px">
Process Mapping </span></td>
<td width="103">
<input type="checkbox" name="chkCourse[]" value=" Process Mapping"></td>
</tr>
<tr>
<td colspan="2" bgcolor="#C0C0C0"><b>WEEK 2</b></td>
</tr>
<tr>
<td width="397"><span style="font-size: 11px">
Financial Management (continued.) </span></td>
<td width="103">
<input type="checkbox" name="chkCourse[]" value="Financial Management"></td>
</tr>
<tr>
<td width="397"><span style="font-size: 11px">
Strategic Marketing </span></td>
<td width="103">
<input type="checkbox" name="chkCourse[]" value="Strategic Marketing"></td>
</tr>
<tr>
<td width="397"><span style="font-size: 11px">
Risk Management </span></td>
<td width="103">
<input type="checkbox" name="chkCourse[]" value="Risk Management"></td>
</tr>
<tr>
<td width="397"><span style="font-size: 11px">
Pilot Testing </span></td>
<td width="103">
<input type="checkbox" name="chkCourse[]" value="Pilot Testing "></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
</body>
</html>
________________________________
Thanks.
|