Insert line breaks in user input

I allow users to post content on my website using HTML TextArea

, but whenever it loads the content, it doesn't contain any lines, even if they hit it twice enter. How can I put the lines in?

+2


source to share


2 answers


What text editor are you using?

If you are not using it, you will need to insert JavaScript <p></p>

or <br /><br />

after every time they hit 'enter'.



Of course, if users are posting content on your site, you also need to look at any HTML they might post and make sure they can't load the "bad" HTML.

Jeff Atwood wrote one such utility for C # . You will need to check if any language you are using on the back supports.

+1


source


If you are displaying the content of a textbox in html you can replace the line queue characters <br/>

.



0


source







All Articles