Populate drop down search form field

3 posts by 2 authors in: Forums > CMS Builder
Last Post: November 6, 2010   (RSS)

By darrylo - November 3, 2010

I wanted to auto populate a drop-down form field in my search form. The field is a text field. The code I'm using of course duplicates the field for each: (i don't want duplicates) is there a way to do this?

I know I can use a text field on my search form but I was hoping I could get a list.

http://ridgefieldconnecticuthomes.com/listings.php

<select name="city">
<option value="">Any Town</option>

<?php
foreach ($listingsRecords as $record) {
print "<option value='{$listingsRecords['city']}'>{$record['city']}</option>";
}
?>
</select>
Darryl
http://darrylo.com

Re: [Jason] Populate drop down search form field

By darrylo - November 6, 2010

Awesome - you're the man Jason - Thank you!
Darryl
http://darrylo.com