Line Breaks not Showing Up in FF
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 posted this at 21:53 — 1st May 2009.
He has: 1,494 posts
Joined: Jun 2008
link? code?
pr0gr4mm3r posted this at 22:41 — 1st May 2009.
He has: 1,502 posts
Joined: Sep 2006
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 posted this at 19:13 — 2nd May 2009.
He has: 1,494 posts
Joined: Jun 2008
loosinglosing
loosing means "letting loose"
greg posted this at 11:13 — 2nd May 2009.
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 posted this at 13:03 — 3rd May 2009.
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 posted this at 13:24 — 3rd May 2009.
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 posted this at 19:12 — 2nd May 2009.
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.