Welcome, Guest. Please Login or Register.
October 07, 2024, 12:35:52 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  <textarea> boxes « previous next »
Pages: [1] Reply Ignore Print
Author Topic: <textarea> boxes  (Read 1943 times)
Ayeka
Jr. Member
**
Posts: 80


Good & Evil, there is never one without the other.

WWW
<textarea> boxes
« on: November 10, 2003, 05:30:38 PM »
Reply with quote

Is there a way to preserve line feeds in a <textarea> entry?  I want people to beable to posts lists, and when viewing them, retain the <enter>s people use:


1)  My dog.
2)  My cat.
3)  My donkey.

currently comes out like:

1)  My dog.  2)  My cat.  3)  My donkey.


Thank you!
Logged

--Ayeka
Master of the purple!
HAHAhahahahahaha!
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:<textarea> boxes
« Reply #1 on: November 11, 2003, 12:42:13 AM »
Reply with quote

Remember to strtr it....

$textarea = strtr($textarea, array("\r" => '', "\n" => '<br .>'));

-[Unknown]
Logged
Daniel Hofverberg
YaBB God
*****
Posts: 582


WWW
Re:<textarea> boxes
« Reply #2 on: November 11, 2003, 10:27:13 AM »
Reply with quote

Or just use PHP's nl2br.
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:<textarea> boxes
« Reply #3 on: November 11, 2003, 05:37:34 PM »
Reply with quote

Quote from: Daniel Hofverberg on November 11, 2003, 10:27:13 AM
Or just use PHP's nl2br.


Except that doesn't remove \r's.

-[Unknown]
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  <textarea> boxes « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.013 seconds with 21 queries.