Site hosted by Angelfire.com: Build your free website today!

Using TEXTAREA attributes
HTML 4.0 introduces new features in Form creation.


<TEXTAREA WRAP= OFF/HARD/SOFT>
The value OFF disables word wrapping in the form control. Any text entered is displayed as is, though users may insert hard returns on their own.

The value HARD allows word wrapping and actual break points are included when the form is submitted.

The value SOFT enables word wrapping in the form control but the line breaks are not sent with the contents of the form.

It is important to keep in mind that these features of TEXTAREA attributes are only supported by Netscape Navigator 2.0 onwards.

For Example, let's look at the value "off" in the following code:
 


coded...
<TEXTAREA NAME="comments" COLS=15 ROWS=5 WRAP="off"> </TEXTAREA>



  A text area with name "comments" is created and spans across 15 columns with 5 rows. Since the WRAP property is set to 'off', the text will continue in one line. The user still gets to write to the next line by pressing the enter key.

The <TEXTAREA> element has accessibility attributes, such as, DIASABLED and TABINDEX.
 


DISABLED
The DISABLED attribute is used to turn off the form control. Elements will not be submitted nor may they receive any focus from keyboard or mouse.

For Example:
 


coded...
<TEXTAREA NAME="comments" COLS=15 ROWS=5 DISABLED>Just for display….No editing! </TEXTAREA>



  A text area with name "comments" is created and spans across 15 columns with 5 rows. Since the DISABLED property is used, the text shown within the text area remains displayed only and the user cannot interact or modify.
 

TABINDEX
The TABINDEX attribute takes a numeric value denoting the position of the form control in the tabbing index for the form. Tabbing proceeds from the lowest positive TABINDEX value to the highest. Form controls that are disabled due to the presence for DISABLED attribute will not be part of the tabbing index.

For Example:
 


coded...
<TEXTAREA NAME="comments" COLS=15 ROWS=5 TABINDEX=2>Enter your text here. </TEXTAREA>



  A text area with name "comments" is created and spans across 15 columns with 5 rows. Since the TABINDEX property is set to '2', the cursor gets displayed within the textarea when the tab is pressed for the second time.