Gossamer Forum
Home : Products : DBMan : Customization :

Build Fancy Multiple Select Fields

Quote Reply
Build Fancy Multiple Select Fields
I was able to install the MOD build_fancy_mult_field & everything is working dandy with it. Smile

However, one minor problem I cannot seem to fix is the fact that I do not want the Multiple Select field to show to the Default User when they search.

JPD addressed something similar in the Regular non-fancy multi select mod - by adding a seperate search routine to show a regular drop down list.

Well, I tried that. Of course in order for a separate search routine to work, I had to use the same sub_build_fancy_mult_field title in the routine or it will not find the entries. And, when I use that..of course it goes right back to showing the entire multiple list.

Does anyone have any clue how one might go about doing this? Like I said the MOD works great. I get the fancy names & the multiple select no problem.

I just need the default users to see a normal drop down list & I cannot figure out how to do it. Unsure

The html.pl file of course looks like this:

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 = (
'Class' => [
['---','Choose as many that apply:'],
['All','All'],
['BRD','Bard'],
['BST','Beastlord'],
['CLR','Cleric'],
['DRU','Druid'],
['DRU','Druid'],
['ENC','Enchanter'],
['MAG','Magician'],
['MNK','Monk'],
['NEC','Necromancer'],
['PAL','Paladin'],
['RNG','Ranger'],
['ROG','Rogue'],
['SHD','ShadowKnight'],
['SHM','Shaman'],
['WAR','Warrior'],
['WIZ','Wizard'],
],
'Race' => [
['---','Choose as many that apply:'],
['BAR','Barbarian'],
['DEF','DarkElf'],
['DWF','Dwarf'],
['ERU','Erudite'],
['GNM','Gnome'],
['HEF','Half Elf'],
['HFL','Halfling'],
['HIE','High Elf'],
['HUM','Human'],
['ISK','Iskar'],
['OGR','Ogre'],
['TRL','Troll'],
['VAH','Vah Shir'],
['ELF','Wood Elf'],
],
);

$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;
}

& I made the changes to the db.cgi that the mod called for as well.

Thanks for any help.
Diana Rae

Last edited by:

dianarae: Feb 3, 2002, 9:17 PM
Subject Author Views Date
Thread Build Fancy Multiple Select Fields dianarae 2848 Feb 3, 2002, 9:10 PM
Thread Re: [dianarae] Build Fancy Multiple Select Fields
dianarae 2757 Feb 4, 2002, 2:49 PM
Thread Re: [dianarae] Build Fancy Multiple Select Fields
Watts 2736 Feb 4, 2002, 3:13 PM
Thread Re: [Watts] Build Fancy Multiple Select Fields
dianarae 2759 Feb 4, 2002, 4:47 PM
Thread Re: [dianarae] Build Fancy Multiple Select Fields
dianarae 2728 Feb 4, 2002, 8:49 PM
Post Re: [dianarae] Build Fancy Multiple Select Fields
Watts 2720 Feb 5, 2002, 9:45 AM