Gossamer Forum
Home : Products : DBMan : Customization :

Multiple Select MOD

Quote Reply
Multiple Select MOD
Okay, it works great, but I was wondering if there might be a way to print a comma and a space instead of pipes between each selected option.

Thanks,



Michael DeLong
Quote Reply
Re: Multiple Select MOD In reply to
$rec{'FieldName'} =~ s/$db_delim/, /g;

The delimiter (however you have defined it in your .cfg file) is part of the structure of DBMan. Changing it in the .db file would require a whole lot of changing in a whole lot of subroutines. If you just put the line above in sub html_record, it'll give the same effect.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Multiple Select MOD In reply to
I'm not sure I understand. Do you mean that I should copy and paste over the multiple select fields what you have below and just change "fieldname" to whatever the field name is?


Michael DeLong
Quote Reply
Re: Multiple Select MOD In reply to
No. Add that line to sub html_record, just after

my (%rec) = @_;

and change the name of the field to match your select field.

This will cause all of the | characters to be replaced by a "comma-space" before they are printed out.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Multiple Select MOD In reply to
Okay, I did that but now there is a ", " between each and every character. Like this:
", P, r, e, s, i, d, e, n, t, "


Michael DeLong
Quote Reply
Re: Multiple Select MOD In reply to
Then try

$rec{'FieldName'} =~ s/\|/, /g;

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Multiple Select MOD In reply to
Perfect, thanks JPD! How do get so good at this stuff?? Smile

Thanks,


Michael DeLong
Quote Reply
Re: Multiple Select MOD In reply to
Glad to help. Smile

It's all experience. I first picked up DBMan three years ago (almost to the day). At that point, I knew nothing about Perl at all. I taught myself about the script by reading it and by buying a few books on Perl.

At that point, there was no one who was willing to help me to work with the script. I had to learn it if I wanted to use the script as I wanted it to be. Sometimes I think I'm not doing folks any favors by giving them answers to their questions.

JPD
http://www.jpdeni.com/dbman/