PDA

Click to See Complete Forum and Search --> : Problem with text stored in database


gardijan
Nov 25th, 2000, 02:16 PM
I have problem with text written in textarea like this and then stored into database. When I store text like this:

This is text I'm inserting into
database.
I'm using "new lines(enter)" which I can't display on my web page.


On my web page It looks like this:

This is text I'm inserting into database. I'm using "new lines(enter)" which I can't display on my web page.

What can I do to awoid this?

parksie
Nov 25th, 2000, 03:09 PM
Either:

a) When storing the text in the database, replace all newlines with "<br>"

b) On the page, enclose the text in <pre></pre> tags.

gardijan
Nov 25th, 2000, 03:22 PM
How can I replace newline with "<br>" if I'm inserting text into textarea box and then inserting into database?

Nov 27th, 2000, 11:34 AM
sHTMLText = Replace(sPlainText, vbcrlf, "<br>" & vbcrlf)

gardijan
Nov 29th, 2000, 11:09 AM
Thanks. It works with <pre> </pre>