holding carriage returns and newlines in a textarea

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
clem_c_rock
Forum Commoner
Posts: 46
Joined: Mon Jun 07, 2004 9:18 am

holding carriage returns and newlines in a textarea

Post by clem_c_rock »

Hello,

I'm having problem w/ a textarea. I lose the newlines and carriage returns in a textarea when I refresh the page from another frameset, I lose all the newlines and carriage returns and the text is combined on one line.

I've tried using the nl2br() function but, when the page is refreshed by another frameset, it replaces the newlines w/ <br />.

any ideas how to overcome this problem?

Thanks for your help.

Clem C.
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Post by Skara »

post your code. sounds like a bug to me. I can't see it just doing that for the hell of it.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

What are you using to print the text into the text area (the value="" or the HTML between the <textarea></textarea> tags)?

Post some code to save us guessing ;-)
clem_c_rock
Forum Commoner
Posts: 46
Joined: Mon Jun 07, 2004 9:18 am

Post by clem_c_rock »

Here's more details on what I'm trying to do. I'm working on an email program that consist of 2 frames - 1 we'll call the address frame and one we'll call the mail frame.

When the user hits a submit button on the address frame, it reloads the mail frame and adds the chosen addresses in the "Recipient" textfield.

If there is text in the address frame textarea it will lose it's formatting and put all text on one line.

I've tried throwing the textarea text from the mail frame to a hidden field in the address frame and then back to the mail frame via javascript but it still didn't work.

Does this make sense?
Post Reply