Hi,
just use the "wrap"-attribute for the textarea. I.E.:
<textarea name="virtual" cols="30" rows="3" wrap="virtual">
This breaks automaticly the line at the end of the textarea.
There are 4 values for the wrap-attribute: soft, hard, virtual and physical.
Soft and Virtual are the same, the difference is that soft only works for netscape. Virtual works also for IE4+ and NS2+.
The same thing for hard and physical. And if you send this textarea to a formular, hard and phsical will send also the linebreaks. Soft and Virtual wont do this!
Netscape developed this attribute to break lines in textareas.
But this is not W3C conform, cause for the W3C the lines should break automaticly without any attributes!
Hope I could help.
Bye fightbulc
Main Topics
Browse All Topics





by: dgoodingPosted on 2004-04-07 at 06:44:44ID: 10774736
http://www.htmlref.com/ref erence/app a/tag_text area.htm
IE - wrap="off | physical | virtual"
NS - wrap="hard | off | soft"
In some versions of Netscape and Microsoft browsers, this attribute controls word-wrap behavior. A value of off for the attribute forces the <textarea> not to wrap text, so the viewer must manually enter line breaks. A value of hard causes word wrap and includes line breaks in text submitted to the server. A value of soft causes word wrap but removes line breaks from text submitted to the server. Internet Explorer supports a value of physical, which is equivalent to Netscape's hard value, and a value of virtual, which is equivalent to Netscape's soft value. If the wrap attribute is not included, text will still wrap under Internet Explorer, but older versions of Netscape, notably Netscape 4, will scroll horizontally in the text box. Given this problem, even though it is nonstandard, it may be a good idea to include the wrap attribute.
<textarea name="comment" rows="10" cols="40" wrap="virtual" align="center"></textarea>