Welcome Guest, Not a member yet? Register   Sign In
how to use nl2br on form_textarea
#1

[eluser]yudahebat[/eluser]
I want to know how we use nl2br on form_textarea??
so when we input some text on it and we press ENTER it became a newline or
Code:
<br />
so on database its save as :
Code:
some text <br />
some text

not

Code:
some text some text

please help me
#2

[eluser]Thorpe Obazee[/eluser]
[quote author="yudahebat" date="1240997441"]
so on database its save as :
Code:
some text <br />
some text

not

Code:
some text some text

please help me[/quote]
You shouldn't use nl2br unless you're outputting it on the web page and not a textarea. About the saving part(saving the &lt;br /&gt; in the database). I don't get why you need it there, any reason for it?
#3

[eluser]yudahebat[/eluser]
what should I use?? I have news DB , on admin I put the news through form_textarea
on webpage I want display it
so when I put the news on form_textarea when I press ENTER it became <br />
#4

[eluser]Thorpe Obazee[/eluser]
[quote author="yudahebat" date="1240997858"]what should I use?? I have news DB , on admin I put the news through form_textarea
on webpage I want display it
so when I put the news on form_textarea when I press ENTER it became <br />[/quote]

As I said in my other reply, when you're outputting on the webpage, you can use the nl2br(). You can also use, auto_typography()
#5

[eluser]yudahebat[/eluser]
I mean if the user use the admin area on the form_textarea they dont need to type
Code:
<br />
.
they just typing and when the want make a newline they just press Enter
how we make it?? what we usa to make that? nl2br??
#6

[eluser]Thorpe Obazee[/eluser]
[quote author="yudahebat" date="1240999513"]I mean if the user use the admin area on the form_textarea they dont need to type
Code:
<br />
.
they just typing and when the want make a newline they just press Enter
how we make it?? what we usa to make that? nl2br??[/quote]

You don't need to type in '&lt;br /&gt;'.
#7

[eluser]Zeeshan Rasool[/eluser]
before using or echo value in view
use:

Code:
echo nl2br($textarea_value);

Keep going




Theme © iAndrew 2016 - Forum software by © MyBB