6 out of 11 rated this helpful - Rate this topic

WRAP attribute | wrap property

[This documentation is preliminary and is subject to change.]

Sets or retrieves how to handle wordwrapping in the object.

Syntax

HTML
<element WRAP="p" ... >
JavaScript
p = object.wrap

Property values

Type: String

(soft)

Default. Text is displayed with wordwrapping and submitted without carriage returns and line feeds.

(hard)

Text is displayed with wordwrapping and submitted with soft returns and line feeds.

(off)

Wordwrapping is disabled. The lines appear exactly as the user types them.

Remarks

To detect the difference between soft and hard you must submit the content within the textArea to an HTTP server.

Examples

This example dynamically sets the wrap property of a textArea to the value selected by the user.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/wrap.htm


<SCRIPT>
function ChangeWrap(oSelect, oTA)
{
    cValue = oSelect.options(oSelect.selectedIndex).value;
    oTA.wrap = cValue;
}
</SCRIPT>
...
<SELECT ID=cboWrap onchange="ChangeWrap(this, txt1)">
<OPTION VALUE=soft>soft
<OPTION VALUE=hard>hard
<OPTION VALUE=off>off
</SELECT>
<P>
<TEXTAREA ID=txt1 STYLE="height:200;width:200"></TEXTAREA>

 

 

Build date: 3/8/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ