Hello,
Check box question
I have the following snippet of code below that appears on the user entry from.
The code basically, lists categories retrieved from the database.
Problem:
if the user incorrectly fills the form the user is sent back to the form to make correction but at the same time the check box the user
selected are lost.
How do I keep the selection in place if the page is refreshed due to errors.
<table class='categoryTable'>
<?php
$setColumn = 5;
foreach($CatBArray as $key => $value)
{ if($key%$setColumn == 0) echo "<tr>";
echo '<td> <input type="checkbox" name="wCatSelection[]" value=" '. $value['cat_index'] . '"> '. $value['cat_name'] . '</td>';
if($key%$setColumn == ($setColumn - 1)) echo '</tr>';
}
?>
</table>