text format

G

Gaze

Hi,

I use <textarea> input more than one paragraph to the database, whose field
type is set to "text". Then I retrieve it to display in <textarea>, which is
OK, paragraph by paragraph, but not in the other tabs because of no <P> or
<br> between each paragraph. Is there any solution to display in other tabs
than <textarea> paragraph by paragraph. Or do I have to change the database
field type other than text? And which type is good in this case. Thanks for
any idea.

Ga
 
G

Gaze

I don't see "cr/lf" in the http source code, but \r\n in database when I use
an sofeware to display the records.
 
D

Dan Brussee

I don't see "cr/lf" in the http source code, but \r\n in database when I use
an sofeware to display the records.

The suggestion is more generic. Replace newline characters with
appropriate HTML tags. Just watch out for things like your example of
\r\n - which would show one line break, but if you use a global
search/replace regular expression and replace \r AND \n with <br> then
you will end up with 2 breaks. Either you need to know that ALL breaks
are the combination of \r\n or you need to do some other fancy
footwork.
 
D

Don Verhagen

In Dan Brussee <[email protected]> typed:
:
:: I don't see "cr/lf" in the http source code, but \r\n in database
:: when I use an sofeware to display the records.
::
:: ::: Gaze wrote:
:::: Hi,
::::
:::: I use <textarea> input more than one paragraph to the database,
:::: whose field type is set to "text". Then I retrieve it to display in
:::: <textarea>, which is OK, paragraph by paragraph, but not in the
:::: other tabs because of no <P> or <br> between each paragraph. Is
:::: there any solution to display in other tabs than <textarea>
:::: paragraph by paragraph. Or do I have to change the database field
:::: type other than text? And which type is good in this case. Thanks
:::: for any idea.
::::
:::
:
: The suggestion is more generic. Replace newline characters with
: appropriate HTML tags. Just watch out for things like your example of
: \r\n - which would show one line break, but if you use a global
: search/replace regular expression and replace \r AND \n with <br> then
: you will end up with 2 breaks. Either you need to know that ALL breaks
: are the combination of \r\n or you need to do some other fancy
: footwork.

Or execute a regexp twice:
1st) replace the 1 pair first \r\n
2nd) replace the \r or \n (can't remember which)

Don
 
L

Lin Ma

I replace enter key chr(13) with <br>. The tab is chr(9)

Replace(yourRecord, chr(13), "<br>")

Lin Ma
 
L

Lin Ma

I solved this issue by using

<% response.write Replace(yourRecord, chr(13), "<br>") %>

Regards,

Lin




rajesh said:
hai lin
i also getting the same problem
if u solved textarea prob
plz mail me
-rajesh
india

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,085
Messages
2,570,597
Members
47,218
Latest member
GracieDebo

Latest Threads

Top