Page 1 of 1

textarea problem

Posted: Sun Jan 18, 2004 8:07 am
by mcog_esteban
hi..i'm using a textarea in aa form, but i can't get correct content of it.
i know that are functions as nl2br, but i think my probelm occurs when i type continualy.
example:if i have a textarea with 10 cols and write 20 chars, i would like to see 2 lines with 10 chars and not a single line with 20 chars.
Does anyone has any idea how to catch the right carriage returns and lines feeds?
thanks.

Posted: Sun Jan 18, 2004 8:21 am
by kettle_drum
Well unless the user presses return at the end of each line then you wont see a new line, since technically its just a single long line.

If you really want to split a long line into several shorter ones the same size as the textarea then just count 20 characters and then add a /n character - if you get my drift.

Posted: Sun Jan 18, 2004 10:20 am
by jason
[php_man]wordwrap[/php_man]

Posted: Sun Jan 18, 2004 1:56 pm
by mcog_esteban
thanks for the answers.