Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert a <br> when user hits enter.

Status
Not open for further replies.

pugs421

Technical User
Joined
Nov 25, 2002
Messages
114
Location
US
I created a way to post news on a site I'm making but when a user hits enter in the textarea no line break is created. I can type <br>, but thats not very user friendly. How do I make it so when A user hits enter it is interpreted as a line break?
 
When you process the form, send the text the user has typed through the php function nl2br(). Then at every new line in the textarea, php will put in a <br>
 
Thanks. Worked great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top