Gossamer Forum
Home : Products : DBMan : Customization :

adding sizes with inches

Quote Reply
adding sizes with inches
hello :)

I need some help. I have a field in which I'm trying to add jewelry sizes such as:

2 1/4" x 5/8"

All works fine when adding records but when the record is modified it is cutting off everything after the first quote (inches).

I thought I found a solution which was adding the code:

$value =~ s/\"/&quot\;/g; ### added for size fields

to sub parse_form, but after having it work on several records, it once again starting to cut off the dimensions after the first quote (inches). Please note it worked fine when just changing the sizes, but when someone else was modifying the record to change the graphic that's when it seems to mess up the size field.

I'm using the single image upload (twice) and here is what my sub parse_form currently is:

sub parse_form { ### replacement sub parse_form for file upload mod
# --------------------------------------------------------
my (%in);
my ($buffer, $pair, $name, $value);

PAIR: foreach $name ($query->param()) {
$value = $query->param("$name");
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

$value =~ s/\"/&quot\;/g; ### added for size fields lcr
$value =~ s/\''/&quot\;/g; ### added for size fields lcr
$value =~ s/^\s+//g; # Trim leading blanks
$value =~ s/\s+$//g; # Trim trailing blanks
unless ($value) { next PAIR; } # eliminate the last | when records are added to the database or when a search is performed.
if ($value eq "http://") { next PAIR; } # Removes default beginning of URLs
if ($value eq "---") { next PAIR; } # This is used as a default choice for select lists and is ignored.
if ($value eq "---") { next PAIR; }
unless ($value) { next PAIR; }
(exists $in{$name}) ?
($in{$name} .= "~~$value") :
($in{$name} = $value);
}
return %in;
}

Does anyone have any suggestions on how to get this to work?

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/

Last edited by:

LoisC: Feb 6, 2006, 10:07 PM
Subject Author Views Date
Thread adding sizes with inches LoisC 4121 Feb 6, 2006, 10:04 PM
Thread Re: [LoisC] adding sizes with inches
JPDeni 4008 Feb 7, 2006, 7:31 AM
Thread Re: [JPDeni] adding sizes with inches
LoisC 4008 Feb 7, 2006, 11:46 AM
Thread Re: [LoisC] adding sizes with inches
JPDeni 4000 Feb 8, 2006, 9:04 AM
Thread Re: [JPDeni] adding sizes with inches
LoisC 4007 Feb 8, 2006, 9:43 AM
Post Re: [LoisC] adding sizes with inches
Watts 4005 Feb 8, 2006, 10:24 AM