![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Hi I have googled but not found a solution to wordwrap in a textarea using firefox/netscape. is there a style sheet solution or am i stuck with not being able to force wrapping in a textarea |
#2
| ||||||||
| ||||||||
|
|
Textarea has wrap attribute set to "logical" ("soft" by IE) by default, |
|
so strings will be wrapped after reaching the opposite border, but only manually typed Enter's will be submitted. |
|
So your task is to prevent wrap, not to enable it ;-) |
|
You can partially emulate wrap="off" by setting textarea style to: white-space: nowrap; |
|
But overall it is more standard and reliable to set "wrap" attribute: "physical" - all visual line breaks are submitted as newlines "logical" - you have visual line breaks but only "hardtyped" breaks are submitted "off" - rather clear I guess :-) |
|
P.S. This attribute is missing in W3C DTD's by mistake |
|
Nevertheless it is supported by all ever existed browsers. |
|
the original Netscape set "logical", "physical" and "off" has better cross-browser support, especially for legacy platforms. |
#3
| |||||||
| |||||||
|
|
VK wrote: Textarea has wrap attribute set to "logical" ("soft" by IE) by default, |
|
The textarea element has no wrap attribute according to the HTML specifications. Browsers generally recognize such an attribute, but information about "logical" as a value is outdated. The currently recognized values are "soft", "hard", and "off". |
|
There is of course no defined default for an attribute that is not defined in the specifications. |
|
Most browsers actually behave as if wrap="soft" had been given, but there is some variation in what this means. This is not surprising, since there is no published specification of what it means. Actually, the specifications more or less say that no wrapping take place, since the idea is that the user can type arbitrarily long lines. See http://www.cs.tut.fi/~jkorpela/forms/textarea.html for some explanations. so strings will be wrapped after reaching the opposite border, but only manually typed Enter's will be submitted. More or less so, but there's a difference between IE and Firefox: if there is a "word" (sequence of characters not containing whitespace characters) that is longer than the textarea width, IE breaks the "word" visually, whereas Firefox introduces horizontal scrolling. I don't think there's a way to change the Firefox behavior (which corresponds to the specifications better than the IE behavior). To see what this means, test this on your browsers: textarea rows=3 cols=12 supercalifragilisticexpialidocious /textarea |
|
P.S. This attribute is missing in W3C DTD's by mistake Please don't try to rewrite history. It was no mistake. Read the actual specifications to learn how textarea was meant to work. Wrapping was later invented by browser vendors and implemented inconsistently and confusingly, as it still is. |
|
Nevertheless it is supported by all ever existed browsers. Any statements about "all browsers" tend to tell about the limited experience of the person who makes the statement rather than the reality around us. |
|
the original Netscape set "logical", "physical" and "off" has better cross-browser support, especially for legacy platforms. You didn't bother actually testing such matters, did you? |
#4
| ||||||
| ||||||
|
|
That was my mistake: the set is "physical", *** virtual *** and "off". |
|
Sorry again for "logical" instead of proper "virtual". |
|
HTML perfectly has wrap attribute since Netscape 3 at least. |
|
To see what this means, test this on your browsers: textarea rows=3 cols=12 supercalifragilisticexpialidocious /textarea You are repeating the same mistake as 7 years ago |
|
- wrap attribute doesn't set a *representation mode* |
|
the original Netscape set "logical", "physical" and "off" has better cross-browser support, especially for legacy platforms. You didn't bother actually testing such matters, did you? I'm not testing - I'm using. |
#5
| |||
| |||
|
|
"WRAP attribute in textarea is not a representation attribute despite it has direct by secondary representation effect. |
#6
| |||
| |||
|
|
Now the test (watch breaks, <textarea... strings should be on one line) - let's go first by IE's model ("hard", "soft", "off"): |
#7
| |||
| |||
|
|
VK wrote: Now the test (watch breaks, <textarea... strings should be on one line) - let's go first by IE's model ("hard", "soft", "off"): Your way of saying that you were totally wrong in your advocation of "physical" and "logical" is implicit but clear. |
|
Your attempt to obfuscate this simple thing by pointless snippets of code, confused attacks at the W3C, etc., makes it also rather clear that you have decided to act destructively. |
|
Don't be surprised if you'll be ignored. |
![]() |
| Thread Tools | |
| Display Modes | |
| |