# Keeping selections in PHP form validation

**URL:** https://forum.kirupa.com/t/keeping-selections-in-php-form-validation/227881
**Category:** programming
**Created:** [June 3, 2007, 2:47pm UTC](https://forum.kirupa.com/t/keeping-selections-in-php-form-validation/227881 "2007-06-03T14:47:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![onemhunki](https://avatars.discourse-cdn.com/v4/letter/o/c57346/32.png) [@onemhunki](https://forum.kirupa.com/u/onemhunki)
#### Post date: [June 3, 2007, 2:47pm UTC](https://forum.kirupa.com/t/keeping-selections-in-php-form-validation/227881/1 "2007-06-03T14:47:48Z")

</div>

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…

```php

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.
