Search Display from DropDown

15 posts by 4 authors in: Forums > CMS Builder
Last Post: October 11, 2010   (RSS)

By Chris - September 12, 2010

Hi sublmnl,

Oops, there's an option for getRecords() that makes things even simpler. You can replace this:

if (sizeof($_REQUEST) == 0) {
$find_a_retailerRecords = array();
}
else {
list($find_a_retailerRecords,) = getRecords(array(
'tableName' => 'find_a_retailer',
));
}


...with this:

list($find_a_retailerRecords,) = getRecords(array(
'tableName' => 'find_a_retailer',
'requireSearchMatch' => true,
));


I learn something new every day! :)
All the best,
Chris
yup. Thanks Chris.
The option/select form works now where it groups the entries under one state and in alpha order too.

Thanks!

One thing I haven't nailed down yet is how to reset the search options to show all the states again.

Now lets say you pick CA it will show the results for CA but once the 'foreach' renders, the option/select form only shows CA as an option.

I understand why because that was the only one requested.... but hmnnnnn
Might put a page reload link on there for now until I get that nailed down.

Re: [sublmnl] Search Display from DropDown

By Chris - September 13, 2010

Hi sublmnl,

Oops! Try changing this setting to false:

// load records
list($all_find_a_retailerRecords, $all_find_a_retailerMetaData) = getRecords(array(
'tableName' => 'find_a_retailer',
'allowSearch' => false,
'loadUploads' => '0',
'orderBy' => 'state',
));


Does that help?
All the best,
Chris
B-I-N-G-O
[cool]