Line Breaks not Showing Up in FF

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

I am loading a page in FF that has a textarea that is pre-populated with a bunch of text. This text was set by another user that unfortunately uses MSIE. When I load that page in FF, all the line breaks are removed, and it's just a jumbled bunch of text. If there an extension or Greasemonkey script that makes FF handle the IE line breaks properly?

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

link? code? Confused

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

link? code?

Private internal system.

All I know is that a textarea field is pre-populated with some data, and that data is loosing all the line breaks. If I view it in IE, the line breaks are retained.

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

pr0gr4mm3r wrote:
data is loosing

losing Wink

loosing means "letting loose"

greg's picture

He has: 1,581 posts

Joined: Nov 2005

Isn't this something to do with either:
A) The HTML form code, EG cols and rows not being set correctly in the form (or differently if you are entering and then viewing in different forms)

B) The way the data is stored in the DB(?)

What I'm getting at is specifying precisely the form attributes and storing correctly the data, it shouldn't look different in one or the other.
Either using correct cols/rows or even adding wrap="xx" to the form.

EG wrap="hard" - although I'm not sure about how "other" browsers handle that, as using wrap in HTML forms often brings varying results in different browsers.

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

The text is wrapping ok, but the line breaks are not taking. This is a system that is used at work. I can't change anything on the system side. The only thing I can do is a workaround on the client side...which is why I mentioned an extension or greasemonkey script. I will post some screenshots of the system Monday and post a copy of the HTML source.

greg's picture

He has: 1,581 posts

Joined: Nov 2005

I presume you have tried nl2br() on the entire content?

If the line breaks "are there" that might force them.

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

this reminds me of a JS quiz engine and editor app I created with lots of form input fields

getting the line breaks and special characters transferred sometimes through multiple stages was tricky

pay extra attention to the code and entities, use JS alert frequently to debug

greg is onto something with wrap - but wrap="hard" does not work in Opera 5.12

you could also do something like adding a certain character or code (eg "<br />" when the enter/return key is pressed (but you say the textare is prepopulated -- so is the text it is prepopulated with have the correct format?)

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.