Gossamer Forum
Home : Products : DBMan : Customization :

other than comma separator for multi-select field

Quote Reply
other than comma separator for multi-select field
hi! im working on making a database to help me keep track of new words i learn. a vocabulary database. so im categorizing each word with associated roots like:

word ---> root
ambidextrous ---> AMB/AMPH (both, more than one)

but when i enter this thing in default.cfg like so
Quote:
# Select fields. Field name => 'comma seperated list of drop down options'.
%db_select_fields = (
etymofam => 'A (without),AB/ABS (off, away from, apart, down),AMB/AMPH (both, more than one)',
);


im getting options like this within the text box:

Quote:

A (without)
AB/ABS (off
away from
apart
down
AMB/AMPH (both
more than one

im a newbie, its amazing i got so far as to customize the looks and configure the script up man...i have no clue what to do...blank really. i hope the colorful demonstration helped? gots any ideas?


thanks

Quote Reply
Re: [ragnar] other than comma separator for multi-select field In reply to
The easiest solution would be to define the field without the extra commas such as using dashes instead, for example:

etymofam => 'A (without),AB/ABS (off-away from- apart - down),AMB/AMPH (both - more than one)',

You might also want to consider using the sub build_select_option_field mod. This would allow you to store just the

A,AB/ABS, and AMB/AMPH within the db file but display the full description in the display.

Check out this thead http://www.gossamer-threads.com/...orum.cgi?post=116995

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] other than comma separator for multi-select field In reply to
yeah i kinda knew about that... im trying to avoid that way coz there are just too many "root" entries to edit and delete all the commas...

i was wondering if there was another easier way than that. i checked out your link ... i dont know what theyre talking about man its like japanese. its ok with the mod, no thanks man.
Quote Reply
Re: [ragnar] other than comma separator for multi-select field In reply to
hey i went with changing all the roots, so thanks man, appreciate it but i got another problem, a search display related. when i search a record the matching entries come in a list right? suppose i search for "ing" and get words that end with ing...now the results come up like this as seen on the screen:

word : run<B>ing</B>

i figured that its got something to do with db.cgi line 527. heres lines 522-531
Quote:
# Bold the results
if ($db_bold and $in{'view_records'}) {
for $i (0 .. (($#hits+1) / ($#db_cols+1)) - 1) {
$offset = $i * ($#db_cols+1);
foreach $field (@search_fields) {
$hits[$field + $offset] =~ s,(<[^>]+>)|($regexp_bold[$field]),defined($1) ? $1 : "<B>$2</B>",ge;
}
}
}
return ("ok", @hits);

i know i can delete the bold formatting and be happy, but how about if i want to bold the results?
Quote Reply
Re: [ragnar] other than comma separator for multi-select field In reply to
If you want to bold the search results than just leave things as they are :)

If you want to turn off bolding following these instructions:

My search is returning with bold tags

1) The easiest solution is to turn off bold in your .cfg file:

$db_bold = 0;

2) In your sub html_record or sub html_record_long, after:
my (%rec) = @_;

Add code:
$rec{'Fieldname'} =~ s/<?.B>//g; ## remove bold

Do this for each field which you will be using to search

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] other than comma separator for multi-select field In reply to
i think u didnt get what i meant. im saying that the tags appear in the search rather than the results being bold themselves. its <B>search</> not search
Quote Reply
Re: [ragnar] other than comma separator for multi-select field In reply to
heyragnarmanyouwillfindthatmostpeoplewritetothisboardusingproperenglish.

If you are as careless with your coding as you are with the childish language and typing in your postings, you will probably find that you have made a syntax error, resulting in the Bold tags appearing.

Check it very carefully, or, at least, provide the snippet of code so that we can help you.
-------------
David Olley
Anglo & Foreign International Limited,
http://www.firehelmets.co.uk

There are 10 types of people in the world: those who understand binary, and those who don't.