I have a simple example of my form:
<html>
<head><title></title></head>
<body>
<table>
<form method="POST" action="checkboxes.php">
<tr>
<td>
Choose Event
</td>
</tr>
<tr>
<td>
Soccer Game
</td>
<td>
<input name="Choice[]" type="checkbox" value="1">
</td>
<td>
<input name="Date[]" type="textbox" value="01/01/2007">
</td>
</tr>
<tr>
<td>
Baseball Game
</td>
<td>
<input name="Choice[]" type="checkbox" value="2">
</td>
<td>
<input name="Date[]" type="textbox" value="01/01/2007">
</td>
</tr>
<tr>
<td>
Basketball Game
</td>
<td>
<input name="Choice[]" type="checkbox" value="3">
</td>
<td>
<input name="Date[]" type="textbox" value="01/01/2007">
</td>
</tr>
<tr>
<td>
<input type="submit" value="submit">
</td>
</tr>
</form>
</table>
</body>
</html>
Since the date fields are filled in, they are being sent in the _POST array, irrespective of when the 'Choice' checkbox has been selected. If I choose two of the three checkboxes, the resultant arrays are:
Array ( [0] => 1 [1] => 2 )
Array ( [0] => 01/01/2007 [1] => 01/01/2007 [2] => 01/01/2007 )
How do I just get the dates that correspond to the checkboxes that were selected??