Welcome Guest, Not a member yet? Register   Sign In
textarea not allowing linebreaks
#5

[eluser]boltsabre[/eluser]
Quote:You’ll need to use an WYSIWYG editor like TinyMCE.
No you don't. What a bloat just for a line break.

What you're looking for is the native php function nl2br($myTextAreaText). It stands for New Line 2 BReak, it basically replaces any line break with the html code <br/>

Use the above function when echo'ing out your data onto your view and you'll see line breaks where you expect them.
However, if you are "editing" your data inside a textarea don't use this function or you'll see html <br/> inside your textarea, which you don't want!


Messages In This Thread
textarea not allowing linebreaks - by El Forum - 01-07-2013, 10:53 PM
textarea not allowing linebreaks - by El Forum - 01-09-2013, 09:45 AM
textarea not allowing linebreaks - by El Forum - 01-09-2013, 09:50 AM
textarea not allowing linebreaks - by El Forum - 01-09-2013, 11:10 AM
textarea not allowing linebreaks - by El Forum - 01-10-2013, 04:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB