Re: [chris] Search Display from DropDown
awesome thanks but now the search drop down select options won't populate.
This is what I put above the <head>
// load records
list($find_a_retailerRecords, $find_a_retailerMetaData) = getRecords(array(
'tableName' => 'find_a_retailer',
'allowSearch' => '1',
'loadUploads' => '0',
'orderBy' => 'city_state_zip',
));
list($find_a_retailerRecords,) = getRecords(array(
'tableName' => 'find_a_retailer',
'loadUploads' => '0',
'allowSearch' => '1',
));
if (sizeof($_REQUEST) == 0) {
$find_a_retailerRecords = array();
}
else {
list($find_a_retailerRecords,) = getRecords(array(
'tableName' => 'find_a_retailer',
));
}
and this is the <form>
<form method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>" >
<select name="state">
<option value="">Select A State</option>
<?php foreach($find_a_retailerRecords as $record): ?>
<option><?php echo htmlspecialchars($record['state']) ?></option>
<?php endforeach ?>
</select>
<input type="submit" name="submit" value="Search">
</form>
I could go back to having the options hard coded, but I kinda liked having it populate based on what Retailers were entered in the CMS.
And thanks for the JS idea. I know where to go from there.