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?
Apr 20, 2000, 12:46 PM
Veteran / Moderator (8669 posts)
Apr 20, 2000, 12:46 PM
Post #2 of 5
Views: 1490
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);
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
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