line terminator for TEXTAREA, IE4.5/Mac

They have: 9 posts

Joined: Mar 2000

Hi,

I am having trouble with a piece of javascript which writes the content of a textarea, specifically the character(s) to use for a line terminator. For all browsers I have access to, except IE4.5 on Mac, writing "\n" causes a line break - but on this browser a square outline character shows, with no line break.

Any ideas? I have tried various things but can't find the answer to this one.

Thanks

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi,

Don't have a mac, but try:

"\r" -- return;
"<br>"
"\x0a0d" cr/lf

Vinny

------------------
GrassBlade: cut&paste javascript
The Javascript Place Forums

Where the world once stood
the blades of grass cut me still

They have: 231 posts

Joined: Feb 2000

I would try combining "\r\n" together. I don't have access to a mac so if you find an answer, could you post it here?

They have: 9 posts

Joined: Mar 2000

Thanks for your suggestions guys.

"\r\n" is better but this actually causes a double line break on Netscape on a Mac!

"\r" on it's own seems to work great on everything (IE5 & NS4 on PC, IE4.5 & NS4 on Mac).

Tim

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi,

As I always suspected, "When in doubt -- try C." (Love carrying over something I learned someplace else, for something else.

Vinny

------------------
GrassBlade: cut&paste javascript
The Javascript Place Forums

Where the world once stood
the blades of grass cut me still

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.