Page 1 of 1

textarea question

Posted: Sat Oct 23, 2004 7:27 am
by cto1mac
I have a textarea in a form. When I write to the db it writes to a blob data type. But it doesn't save the formatting. Is there anything that I can do to save the formatting from the textarea? For example if someone enters a blank line by hitting enter twice I want the value entered in the db to have that blank line. As it is right now it strips out the blank line and just writes the entire value out in one long string of characters.

Thanks

Posted: Sat Oct 23, 2004 7:51 am
by EvilOne
for new row format the text using [php_man]nl2br()[/php_man] function

Posted: Sat Oct 23, 2004 8:00 am
by timvw
You are mistaken, the format is not lost.

But, as you should know, html ignores newlines etc...... As suggested, use [php_man]nl2br[/php_man]

Posted: Sat Oct 23, 2004 2:43 pm
by vigge89
otherwise, you can use the css-attribute:

Code: Select all

white-space: pre;
makes newlines appear as newlines ;)