Since you experiencing PROBLEMS with accessing the page...here is the Mod:
################################################################################
# #
# MULTIPLE SELECT MOD v.2.0 #
# #
# --------------------------------------------------------------- #
# Multiple Select Mod for Adding, Modifying, and Deleting Records #
# --------------------------------------------------------------- #
# This Mod allows you to create drop-down menus for selecting multiple values #
# for fields in your database. This version also works for search forms in #
# your databases. #
# #
# #
# Co-written by Eliot Lee and Carol Hall (JPDeni, DBMAN Forum Moderator). #
# #
# For technical assistance, please post messages in the DBMAN Discussion Forum#
# #
# http://www.gossamer-threads.com/scripts/forum/ #
################################################################################
(1) Add the following sub-routine to your html.pl file:
===============================================================================================
sub build_fancy_mult_field {
# --------------------------------------------------------
#
# To call this subroutine from html_record_form, use the following syntax:
#
# print &build_fancy_mult_field("FieldName",$rec{'FieldName'});
#
# Be sure to express the field name *exactly* as it is defined in your .cfg file.
#
$size = "5";
my $field = $_[0];
my $compare = $_[1];
my %selector = (
'FieldName1' => [
['---','Choose as many that apply:'],
['Value1','Value1'],
['Value2','Value2'],
['Value3','Value3'],
['Value4','Value4'],
['Value5','Value5'],
],
'FieldName2' => [
['---','Choose as many that apply:'],
['Value1','Value1'],
['Value2','Value2'],
['Value3','Value3'],
['Value4','Value4'],
['Value5','Value5'],
],
);
$output = qq|<SELECT NAME="$field" MULTIPLE SIZE="$size">\n|;
$i = 0;
while ( $selector{$field}[$i][0] ) {
$compare =~/$selector{$field}[$i][0]/ ?
($output .= qq|<OPTION VALUE="$selector{$field}[$i][0]" SELECTED>$selector{$field}[$i][1]\n|) :
($output .= qq|<OPTION VALUE="$selector{$field}[$i][0]">$selector{$field}[$i][1]\n|);
++$i;
}
if ($i) {
$output .= "</SELECT>";
}
else {
$output = "Incorrect field definition";
}
return $output;
}
===============================================================================================
NOTE: You will have to make the following changes to this sub-routine:
1. Change FieldName1 and FieldName2 to the field names that you want to have this
multiple selection drop-down menu.
2. Change the "Value*" to the values of your fields.
3. Change the value of $size variable to the number of rows that you want to
appear in the drop-down menu. It should look like the following:
$size = "5";
Replace the number between the double quotes.
(2) Add the following codes to the following sub-routines in your html.pl file:
sub html_record_form, sub html_record, and/or sub html_html_record_long.
print &build_fancy_mult_field("FieldName",$rec{'FieldName'});
NOTE: Replace FieldName with the field name that you defined in the sub build_fancy_mult_field
routine.
(3) Replace the following codes in your sub query routine in the db.cgi file:
my ($i, $column, @search_fields, @search_gt_fields, @search_lt_fields, $maxhits, $numhits, $nh,
$field, @regexp, $line, @values, $key_match, @hits, @sortedhits, $next_url, $next_hit, $prev_hit,
$first, $last, $upper, $lower, $left, $right, $restricted);
with the following codes:
my ($i, $column, @search_fields, @search_gt_fields, @search_lt_fields, $maxhits, $numhits, $nh,
$field, @regexp, $line, @values, $key_match, @hits, @sortedhits, $next_url, $next_hit, $prev_hit,
$first, $last, $upper, $lower, $left, $right, $restricted, $key);
(4) Add the following codes in your sub query routine in the db.cgi file:
foreach $key (keys %in) {
if ($in{$key} =~ /~~/) {
$in{$key} =~ s/~~/|/g;
$in{'re'} = 1;
}
}
AFTER the following codes:
local (%sortby);
(5) Add the following codes in your sub html_record routine or search form
routine in the html.pl file:
|; print &build_fancy_mult_field("FieldName",$rec{'FieldName'}); print qq|
Replace FieldName with the name of your multiple select field name.
Note: You also might want to add hints in your search form, like the
following:
"To choose multiple options, hold your Ctrl key and mouse button."
THIS IS THE LAST TIME I AM POSTING THIS MOD IN THIS FORUM! I HAVE ALREADY POSTED THE MOD ABOUT THREE TIMES OVER THE PAST TWO MONTHS!
Regards,
------------------
Eliot Lee Anthro TECH,L.L.C
www.anthrotech.com * Be sure to visit the
Resource Center for
FAQ's,
Modifications and
Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------