|
-
Jan 18th, 2007, 02:50 PM
#1
Thread Starter
New Member
Keep formatting with text area
I have a form in which the user enters data in a text area and the data is saved in my SQL database. The problem is that, for example, if you create a new paragraph in the text area, the formatting is lost when saved to the database and all the sentences are ran together with no blank lines.
How do I preserve the spacing and formatting used in the text area? Thanks for your help!
-
Jan 18th, 2007, 02:53 PM
#2
Re: Keep formatting with text area
Are you sure the formatting is lost upon saving? I very much doubt so. Check the HTML source code that is output.
I think this happens only upon displaying the HTML. And the reason for it is, of course, that the HTML and CSS specs say that all whitespace is collapsed into a single space character.
The easiest way to get around this is to user the nl2br() function.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 18th, 2007, 02:55 PM
#3
Thread Starter
New Member
Re: Keep formatting with text area
Would the wrap="physical" attribute have anything to do with this?
-
Jan 18th, 2007, 02:57 PM
#4
Re: Keep formatting with text area
That attribute does not exist in any standard I'm aware of.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|