I have a form with multiple rows of checkboxes, each with a specific id, that are being displayed using a foreach
loop.
How do you grab the $_POST
info from something like that? I think it is like this somehow $_POST[][]
, like a sub-array, but I cant figure out how to set it up:
foreach($stakholderArray as $currentEntry) {
print "<tr class='$bgcolor'>";
print "<td class='left'>$currentEntry[org]</td>";
if($currentEntry['dataFound']) {
//if data was found for current stakeholder, display it
print ($currentEntry['Partner']) ? '<td><input type ="checkbox" checked ="checked" /></td>' : '<td><input type ="checkbox" /></td>';
print ($currentEntry['Agreement']) ? '<td><input type ="checkbox" checked ="checked" /></td>' : '<td><input type ="checkbox" /></td>';
print ($currentEntry['Train']) ? '<td><input type ="checkbox" checked ="checked" /></td>' : '<td><input type ="checkbox" /></td>';
print ($currentEntry['Meet']) ? '<td><input type ="checkbox" checked ="checked" /></td>' : '<td><input type ="checkbox" /></td>';
}
else { //else...no stakeholder data, display empty columns
print "<td><input type ='checkbox'/></td><td><input type ='checkbox'/></td><td><input type ='checkbox'/></td><td><input type ='checkbox'/></td><td><input type ='checkbox'/></td>";
print "</tr>";
}## Heading ##