Gossamer Forum
Home : Products : DBMan : Customization :

Search fields

Quote Reply
Search fields
I have a search page set up with the options within each field set out as check boxes. Now lets say each field has 10 options and I only want the first 4 as checkbox options and a dropdown box with the remaining 6. Is it possible to search this way?
Quote Reply
Re: Search fields In reply to
I suppose you could.

You would have to give the checkboxes the same name to match the field name, as well as the select field.

You will also need to add the following to sub query in the db.cgi file, after

local (%sortby);

Code:
foreach $key (keys %in) {
if ($in{$key} =~ /~~/) {
$in{$key} =~ s/~~/|/g;
$in{'re'} = 1;
}
}

(Thanks to Eliot for that code. It's taken from his "Multiple Fancy Select Field" mod.)

Be aware that you probably will not get the results you might think you should. The search will return records that have *any one* of the items selected.


------------------
JPD






Quote Reply
Re: Search fields In reply to
Works fine for me thanks
Quote Reply
Re: Search fields In reply to
Is it possible to have a null or --- category in the drop down that won't be searched on?
Quote Reply
Re: Search fields In reply to
Yep. If you include

---

as one of your options, it will be considered no entry in the field.


------------------
JPD