Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: inserting HTML formatting

Quote Reply
Re: inserting HTML formatting In reply to
I would do this only for displaying, not when saving the data. You should really save the data without html formatting, and then format it for display. This makes it easier when you need to put it into a form field, or perhaps email the data.

You could do all the fields like:

foreach ($in->param) {
$val = $in->param($_);
$val =~ s/\n/<br>/g;
$in->param($_, $val);
}

assuming you wanted to do it for a CGI object. If it's just in a hash:

foreach (keys %in) {
$in{$_} =~ s/\n/<br>/g;
}

Hope that helps,

Alex
Subject Author Views Date
Thread inserting HTML formatting rholmin 13588 Nov 7, 1999, 7:47 PM
Post Re: inserting HTML formatting
Alex 13384 Nov 7, 1999, 9:20 PM
Post Re: inserting HTML formatting
Digital Concepts 13393 Nov 7, 1999, 10:06 PM
Post Re: inserting HTML formatting
rholmin 13420 Nov 8, 1999, 7:07 AM
Post Re: inserting HTML formatting
pugdog 13394 Nov 8, 1999, 10:42 AM
Post Re: inserting HTML formatting
rholmin 13383 Nov 8, 1999, 5:04 PM
Post Re: inserting HTML formatting
rholmin 13408 Nov 8, 1999, 5:14 PM
Post Re: inserting HTML formatting
Alex 13406 Nov 8, 1999, 7:23 PM
Post Re: inserting HTML formatting
rholmin 13411 Nov 9, 1999, 7:17 PM
Post Re: inserting HTML formatting
hostglobal 13395 Dec 7, 1999, 5:14 PM
Post Re: inserting HTML formatting
hostglobal 13401 Dec 7, 1999, 5:33 PM
Post Re: inserting HTML formatting
Alex 13397 Dec 9, 1999, 4:16 PM
Thread Re: [rholmin] inserting HTML formatting
cdkrg 13251 Oct 5, 2003, 9:54 PM
Thread Re: [cdkrg] inserting HTML formatting
Andy 13283 Oct 6, 2003, 1:21 AM
Post Re: [Andy] inserting HTML formatting
cdkrg 13260 Oct 6, 2003, 1:27 AM