textarea problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mcog_esteban
Forum Contributor
Posts: 127
Joined: Tue Dec 30, 2003 3:28 pm

textarea problem

Post 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.
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post 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.
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

[php_man]wordwrap[/php_man]
mcog_esteban
Forum Contributor
Posts: 127
Joined: Tue Dec 30, 2003 3:28 pm

Post by mcog_esteban »

thanks for the answers.
Post Reply