(Site Identification)

'Eye' Focus: Web Support Tutorials

Forms: TEXTAREA - Multiple Line Text Boxes


The TEXTAREA tag provides for a form field which allows a larger area for entering text.

(to Top) Example TEXTAREA:



Syntax: (skip code)

<label for="...">...</label><br>
<textarea id="..." name="..." rows="..." cols="..." style="white-space:normal;"></textarea>

(to Top) Definitions


ROWS:

ROWS defines the number of text lines to be used to display the text.

COLS:

COLS defines the width of the box in characters.

Text Wrapping:

The old method of using WRAP to define how long lines of text will wrap in a TEXTAREA box has been depricated (removed from common usage). While WRAP was never officially part of the HTML code specifications, it had support by almost all browsers. Now the preferred method is to define how to wrap the text with a style sheet.

There is three types of text wrapping options available using the style sheet 'white-space' attribute: white-space:normal;, white-space:pre;, and white-space:nowrap;. If your DOCTYPE was declared as HTML 4.0 or above, then the text wrapping type 'should' automatically be assumed to be 'normal' (unformatted long lines, containing only characters that were typed). The 'pre' option will normally send the contents of the box as it is viewed, with extra carriage returns added where the lines wrapped on the box. The 'nowrap' option will cause the content to extend past the right side of the box and will only display a new line when a carriage return has been entered.

An attribute that is also not part of HTML is the use of MAXLENGTH for text the TEXTAREA field. While some browsers like Internet Explorer recognize and apply this attribute it should not be relied upon. The attribute for this tag is ignored in all but a very few browsers.

If in doubt of the proper support or use of an HTML tag or attribute, we suggest that you check the IndexDOT site. You will find a full list of tags, definitions, and support by the major browsers there, and what is actually valid for each level of language.


[Updated: Sunday, November 18, 2007]