Reputation: 13756
I only want to maintain the paragraph structure of the users input into a textbox. When I retrieve the text from db, all structure is lost. What's easiest way to save text as recorded?
Upvotes: 4
Views: 2181
Reputation: 7395
replace spaces " " with
You can't repeat multiple spaces " " in HTML, as they will be collapsed into one space.
Also, replace \n with <br />
Hope that helps!
Upvotes: 0
Reputation: 12610
If you want to store HTML text (rich text with BOLD , Italic and etc) you have to use an editor like CKEditor (http://www.ckeditor.com)
Upvotes: -1