Gossamer Forum
Home : Products : DBMan : Customization :

new lines

Quote Reply
new lines
hi, i would like to know how do you force it to accept new lines?

like i when i wish to add:

this is line one
this is line two line two

however when you go and view that record.. it comes up like:

this is line one this is line two line two

(putting that into the "description" box)

im just try this on the demo (which ive installed)

any ideas?
thanks,


Warp.

Quote Reply
Re: [Warp] new lines In reply to
Search this forum for "line breaks" - you'll find what you need. Sly
_______________________________________________________
Lem Motlow, Proprietor Lynchburg (pop 361), Tenn.
Quote Reply
Re: [Tom58] new lines In reply to
thanks!

found the ode to fix that, however the first line has a blank space at the start of the first line..

instead of:

and now

its:
and now

thanks,


Warp.

Last edited by:

Warp: Dec 17, 2001, 10:46 PM
Quote Reply
Re: [Warp] new lines In reply to
Warp,

Instead of \n for new line,
Use \r for carriage return.


this is line one \rthis is line two line two

this will give you:

this is line one
this is line two line two

In a textarea box.
beetlemanTongue

Marcus L. Griswold
Quote Reply
Re: [beetleman] new lines In reply to
this is what I did .....got the answer here on the forums

put the bold text into your html.pl or what ever file you are using for your .pl


Code
sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.
# This is the "short display" -- the list of records that are returned
# from a search. my (%rec) = @_;$rec{'Log_A'} =~ s/\n/<BR>/g;
$rec{'Log_B'} =~ s/\n/<BR>/g;




change 'Log_A' 'Log_B' to the text area name you want this to work. ( the name you called the field to be filled in)

example from my cfg file


Code
Log_A => [6, 'alpha', '45x20', 25000, 0, '', ''],
Log_B => [7, 'alpha', '45x20', 25000, 0, '', ''],





If you are using the Long/short mod also put it here


Code
sub html_record_long {
#----------------------------------------------------------------
my (%rec) = @_;$rec{'Log_A'} =~ s/\n/<BR>/g;
$rec{'Log_B'} =~ s/\n/<BR>/g;




hope this helps......
Quote Reply
Re: [amfreak] new lines In reply to
>>
# from a search. my (%rec) = @_;$rec{'Log_A'} =~ s/\n/<BR>/g;
$rec{'Log_B'} =~ s/\n/<BR>/g;
<<

Well that won't work as half the code is on a commented out line...

# from a search.
my (%rec) = @_;
$rec{'Log_A'} =~ s/\n/<BR>/g;
$rec{'Log_B'} =~ s/\n/<BR>/g;
Quote Reply
Re: [RedRum] new lines In reply to
I must be doing some thing wrong when i paste into this forum. My code dont look like anything thats shows when i paste it here.

The way you have it is how it loooks in my pl file.

I just switched the reply area back to the default ( a small green box) I wonder if this will work better?

Code:

sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.
# This is the "short display" -- the list of records that are returned
# from a search.

my (%rec) = @_;

$rec{'Log_A'} =~ s/\n/<BR>/g;
$rec{'Log_B'} =~ s/\n/<BR>/g;
Quote Reply
Re: [amfreak] new lines In reply to
If you are using the short/long mod you will want to add your codes to the top of both:

sub html_record and sub html_record_long

Hope this helps


Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [Warp] new lines In reply to
thanks ppl...

ill have a go soon

thanks!

have a good xmas (if you have it) and new year!

Warp.