Click to return to home page
Richard Lowe Jr Home

<TEXTAREA> and </TEXTAREA>

Description Attributes Examples

Description:

The <TEXTAREA> tag is used in forms to get multiple lines of text from the user.

Attributes:

accesskey="char"

Sets the access key to the character.  This allows key sequences to be pressed by a user to proceed directly to certain fields. On Windows, keys are proceeded by ALT and on Macintosh by CMD.

cols="n"

Number of columns in the text box.

disabled

Disables input for the field.

name="name"

The name of the field. Valid names are typically defined by the routine specified in the ACTION attribute of <FORM>.

onblur=JavaScript

Javascript routine to be executed if the field losses the focus (is the field receiving input at the current time).

onchange=JavaScript

Javascript routine to be executed if the field changes.

onfocus=JavaScript

Javascript routine to be executed if the field gets the focus (is the field receiving input at the current time).

onselect=JavaScript

Javascript routine to be executed if some text or element is selected. Very useful for <TEXTAREA>.

readonly

Indicates the field may not be modified by the user.

rows="n"

Number of rows in the text box.

Examples:

<form method="POST" 
    action="http://rloweweb.com/cgi-bin/ennyfrms.cgi">
  <p><textarea name="Comments" rows="5" cols="54" Wrap="virtual">
  </textarea></p>
  <input type="submit" value="Submit" name="B1">
  <input type="reset" value="Reset" name="B2"></p>
</form>


As you can see, <TEXTAREA> produces a nicely formatted box for getting lines of text from the user.

 


Unless otherwise noted, all photos and text is Copyright © Richard G Lowe, Jr.