Keeping selections in PHP form validation

Hi folks,

Another question for you. I have a complicated form that has to self validate during processing. I generate a list of properties based on a database, but during form validation the selections disappear. I know how to do this with simple input fields, but as this list is generated via php not sure how to get it right.

This is what I have that is not working…


if($total_brent > 0){
echo '<table width="350" border="0" align="left" cellpadding="1" cellspacing="0">';
echo '<tr bgcolor="#E9FFF3" width ="350"><td><input type="checkbox" name="borough[]" value="Properties in Brent"> <b>Brent</b></td></tr>';
echo '</table>';
while($rows=mysql_fetch_array($brent)){
$name = $rows['prop_Name'];
$region = $rows['prop_Region'];
echo '<table width="350" border="0" align="left" cellpadding="1" cellspacing="0">';
echo '<tr><td><input type="checkbox" name="properties[]" value='.$_POST['properties'].'>'."$name". '</td></tr>';
echo '</table>';
}

Any ideas or pointers, as usual greatly received.