Attribute for <TEXTAREA ...>
WRAP =
SOFT
| HARD
| OFF
Usage Recommendation |
use it, but don't rely on it |
WRAP
describes how the text in the text area should wrap at the end of lines. Until this attribute came along, browsers generally did not do word wrapping. If you typed a line that was longer than the display area, the line just kept going, hopefully with the display area scrolling along. This was not the way people are used to entering text, so Netscape added the WRAP
attribute.
SOFT
wraps long lines in the text area for easy editing, much like a word processor. It does not, however, send the carriage returns to the server. This type of wrap is probably the most useful because it is the easiest for the user to edit, but it does not actually change any of their data. HARD
looks to the user like SOFT
, but the carriage returns the user sees are sent to the server.
OFF
does not wrap at all; it displays and sends the text exactly as typed in.
You may from time to time see other variations on
WRAP
, such as
VIRTUAL
or
PHYSICAL
. Netscape introduced these attributes a few years ago as proposed extensions to HTML 3.0, then abandoned them. Officially, the HTML 4.0 specs don't list WRAP, but Netscape and MSIE list
WRAP = HARD | SOFT | OFF
in their guides. It's best to stick these three values.