Gossamer Forum
Home : Products : DBMan : Customization :

Hidden Fields/Search

Quote Reply
Hidden Fields/Search
I have added the "simultaneous field searching script", but I also have a hidden search condition:

<input type=hidden name="CIH" value="Yes">

The mod ignores the hidden condition. How can I search across two fields and have it report only those that first meet the <input type=hidden name="CIH" value="Yes">, then the search criteria entered by the client? The single input fields work the hidden condition.

In the html.pl I added:
#Search across two fields simultaneously

sub combined_field_search{
#---------------------------------------------------------
my ($search_term) = 'spec_comment';
my (@multi_fields) = ('Specialization','Comments');
if (!$in{$search_term}) {return;}
my ($field);
foreach $field (@multi_fields) {
$in{$field} = $in{$search_term};
}

$in{'ma'} = '1';
}

#if I set ma = 0, I get no results
------------------------------

db.cgi added:

sub view_records {
# --------------------------------------------------------
# This is called when a user is searching the database for
# viewing. All the work is done in query() and the routines just
# checks to see if the search was successful or not and returns
# the user to the appropriate page.

&combined_field_search;

my ($status, @hits) = &query("view");
if ($status eq "ok") {
&html_view_success(@hits);
}
else {
&html_view_failure($status);
}
}

I need the combined search to search across the two fields and report those records where <input type=hidden name="CIH" value="Yes">.

Thanks in advance for your help.
Tommy



Subject Author Views Date
Post Hidden Fields/Search tgardner 726 Dec 15, 2000, 5:29 AM