Gossamer Forum
Home : Products : DBMan : Customization :

Search by User Link - drop down menu control

Quote Reply
Search by User Link - drop down menu control
Hello,
I am using a relational database.
How can I control what fields/information are displayed in the drop down menu when I click on "Search by User"?

Regards-Chef Mars
Quote Reply
Re: [chefmars] Search by User Link - drop down menu control In reply to
I need to see the code you're using for your dropdown at this point.


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
Quote Reply
Re: [JPDeni] Search by User Link - drop down menu control In reply to
JPDeni,
Thanks for the reply and offer to help.
Thanks to your request for me to post the code I found out where I can control and change the drop down menu. (see red text below)

Once again a big thanks on this week devoted to giving thankx.
---------------------------------------------------

sub html_search_form form from user_html.pl.

Code:
sub html_search_form {
# --------------------------------------------------------
# The form fields that will be displayed each time a record is
# edited (including searching). You don't want to put the
# <FORM> and </FORM tags, merely the <INPUT> tags for each field.
# The values to be displayed are in %rec and should be incorporated
# into your form. You can use &build_select_field, &build_checkbox_field
# and &build_radio_field to generate the respective input boxes. Text and
# Textarea inputs can be inserted as is. If you turn on form auto
# generation, the program will build the forms for you (all though they may
# not be as nice). See the README for more info.

my (%rec) = @_;

open (DB, "<$db_file_name") or &cgierr("error. unable to open db file: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
@lines = <DB>; # Slurp the database into @lines..
close DB;

foreach $line (@lines) {
next if $line =~ /^#/;
next if $line =~ /^\s*$/;
chomp $line;
@data=&split_decode($line);
$data{'so'} = 'ascend';
$user_list{$data[2]}[0] = $data[0];
$user_list{$data[2]}[1] = "$data[1], $data[2] - $data[7]";
}
print qq|<select NAME="UserID">|;
foreach $user (sort { lc($user_list{$b}) cmp lc($user_list{$a}) } keys %user_list) {
print qq|<OPTION VALUE="$user_list{$user}[0]">$user_list{$user}[1]</OPTION>|;
}
print qq|</SELECT>|;
}

}

Last edited by:

chefmars: Nov 24, 2006, 11:45 AM
Quote Reply
Re: [chefmars] Search by User Link - drop down menu control In reply to
I'm going to need sub html_search_form, at least. I may need more, depending on what I find there. :-)


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.