Forum Moderators: open

Message Too Old, No Replies

Formatting input entered in a Form textarea

how to generate paragraphs and breaks

         

wfernley

8:33 pm on Feb 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello,

I think this is an easy question to answer....at least I hope it is.

I am building a form which has a text area where the user will enter in a review for a product. I was curious how I could format what they enter. It will usually be a few paragraphs but once they submit the text area it won't save it in the correct format. How would I do this? Basically how do I make it know they started a new paragraph and have it automatically enter a <p> or <br>

thanks :)

Wes

wfernley

8:55 pm on Feb 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



After a bit of searching I found my solution. Everytime a person pushes enter in an input text field it generates a \n which you dont see. So using PHP you can replace the \n with <br>. Works like a charm.

Wes

[edited by: rogerd at 2:38 am (utc) on Feb. 22, 2005]
[edit reason] No URLs please... [/edit]