Text is wrapping in textarea [SOLVED]

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Text is wrapping in textarea [SOLVED]

Post by pickle »

Hi all,

This is a problem only with Firefox, not with IE:

I'm pulling a string out of a db and inserting it into a textarea for editing. The problem I'm having is that the string is wrapping after X width, regardless of the width of the textarea. If set the textarea to cols=100, and set the style width to 100%. The problem surfaces with both these settings.


I've stripped out all "\n", "\r\n","\r" (where 'r' is supposed to be the letter after 'Q' in the alphabet) characters and the text is still wrapping. If I output that same text (wrapped in <pre></pre> tags) outside of the textarea, the text doesn't wrap.

Like I said, this works fine in IE, just not Firefox - any ideas?

Thanks folks

EDIT: Why is it that I can work half a day on a problem, and then figure out the solution 10 minutes after I ask for help?

The problem I was having was with the Javascript I was using to put the code in the textarea. For some reason, it was stripping all new lines in IE, and the second of 2 consecutive new lines in Firefox.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply