how to use nl2br on form_textarea |
[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 /> Code: some text <br /> not Code: some text some text please help me
[eluser]Thorpe Obazee[/eluser]
[quote author="yudahebat" date="1240997441"] so on database its save as : Code: some text <br /> 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 <br /> in the database). I don't get why you need it there, any reason for it?
[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 />
[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()
[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??
[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 '<br />'.
[eluser]Zeeshan Rasool[/eluser]
before using or echo value in view use: Code: echo nl2br($textarea_value); Keep going |
Welcome Guest, Not a member yet? Register Sign In |