It took my a while to figure this out, so I thought I'd post it here in case someone else found it useful. It's really pretty simple, but those of us who only read a little php need all the help we can get.
If you want to create a dropdown that is populated with records from a table in your database, modify this code to your needs and put it in Form Code->Form HTML:
Oh, and here's the link to the famous "sofia's property listings" thread if you were looking for that, or just want to take this concept to another level (including AJAX thanks to Max): http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=5&t=6838&start=0&st=0&sk=t&sd=a&hilit=sofia
If you want to create a dropdown that is populated with records from a table in your database, modify this code to your needs and put it in Form Code->Form HTML:
<?php
$sql ="select DISTINCT your_field_name from jos_your_table_name order by your_field_name ASC";
$database->setQuery($sql);
$rows = $database->loadObjectList();
foreach ($rows as $row) {
$selectOptions .= "<option value=\"$row->your_field_name\">$row->your_field_name</option>";
}
?>
<select>
<option value="">Any</option>
<?php echo $selectOptions ?>
</select>
Oh, and here's the link to the famous "sofia's property listings" thread if you were looking for that, or just want to take this concept to another level (including AJAX thanks to Max): http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=5&t=6838&start=0&st=0&sk=t&sd=a&hilit=sofia