ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

how to use nl2br on form_textarea

April 29, 2009 1:30am

Subscribe [2]
  • #1 / Apr 29, 2009 1:30am

    yudahebat

    73 posts

    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

    
    

    so on database its save as :

    some text 
    
    some text

    not

    some text some text

    please help me

  • #2 / Apr 29, 2009 1:33am

    Thorpe Obazee

    1138 posts

    so on database its save as :

    some text 
    
    some text

    not

    some text some text

    please help me

    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?

  • #3 / Apr 29, 2009 1:37am

    yudahebat

    73 posts

    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

  • #4 / Apr 29, 2009 1:42am

    Thorpe Obazee

    1138 posts

    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

    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 / Apr 29, 2009 2:05am

    yudahebat

    73 posts

    I mean if the user use the admin area on the form_textarea they dont need to type

    
    

    .
    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 / Apr 29, 2009 2:23am

    Thorpe Obazee

    1138 posts

    I mean if the user use the admin area on the form_textarea they dont need to type

    
    

    .
    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??

    You don’t need to type in ‘<br />’.

  • #7 / Apr 29, 2009 4:18am

    Zeeshan Rasool

    261 posts

    before using or echo value in view
    use:

    echo nl2br($textarea_value);

    Keep going

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases