Gossamer Forum
Home : Products : DBMan : Installation :

Carriage Returns?

Quote Reply
Carriage Returns?
I have a Book Review db. A 2000 character Description field contains the actual review text.

Question: Is it possible to embed carriage returns [paragraphs] in the text?

Thanks.
Quote Reply
Re: [jmueller] Carriage Returns? In reply to
On the top of either your html_record or html_record long after my (%rec) = @_;

add:

$rec{'description'} =~ s/\n/<BR>/g;

changing description to the name for your textarea field name.

These and other tips can be found in the FAQ noted below.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Carriage Returns? In reply to
Lois
Thanks for the reply.

I'm confused. First, let me re-explain in case I was unclear.

In this field:
'Description' => [ 3, 'alpha', 255, 2000, 0, '', ''],
<textarea name="Description" cols="70" rows="10">$rec{'Description'}</textarea>

... We're entering a book review -- up to 2,000 characters of text.

The problem is, the nicely formatted line breaks/paragraphs we see in the above entry field don't translate to the db display.

I need to know how to make the description field display as entered -- with the formatted paragraphs. Is that possible?

Is that how you understood my issue?

I did look at the FAQ you referred me to. Maybe you could elaborate. I don't see how that resolves the problem.

Thanks.
Quote Reply
Re: [jmueller] Carriage Returns? In reply to
Did you actually try what LoisC suggested? It should work for what you describe.
_______________________________________________________
Lem Motlow, Proprietor Lynchburg (pop 361), Tenn.
Quote Reply
Re: [jmueller] Carriage Returns? In reply to
Lois...

Okay... I tried your fix and all is well. Thanks for the assist.

Jim
Quote Reply
Re: [jmueller] Carriage Returns? In reply to
You could also use:

$rec{'description'} =~ s/\r/<P>/g;

...to convert carriage returns to paragraphs.
Quote Reply
Re: [RedRum] Carriage Returns? In reply to
You may want to define your textarea field in your .cfg file as:

'Description' => [13,'alpha','70x10',2000,0,'',''],

This way you can control the size of the textarea displayed and be compatible with how the script recognized the field.

Unoffical DBMan FAQ

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