MF Web Services logo

HTML Help & Resources

Form Input (Textarea)

Textarea allows for multi-line, text, input from users, to be used in combination with form data. Textarea requires a closing tag in order to function properly. The ROWS and COLS properties allow you to define the height and width of the textbox, however, CSS style has more accurate methods to define the height and width of the textbox.

To show a default message, place text in between the opening and closing tags, and it will appear inside the user's textbox. See examples below.

The elements of style, and how to use them, are not covered in this reference. For more information on how to utilize the power of cascadding style, visit our CSS reference instead.

  • NAME

    Name must be identified in order to access user input. Avoid using spaces or non-alpha numeric characters for the name identifier.

  • ROWS

    Rows defines the number of text rows available for input. However, box is scrollable, vertically. Rows actually defines the height of the box, however, CSS has a better, and more reliable method of determining box height.

  • COLS

    Cols defines the number of text columns available for input. Cols actually defines the width of the box, however, CSS has a better, and more reliable method of determining box width.

  • READONLY

    Input will not be allowed when this parameter is set, as whatever the value is set to initially, will remain.

  • DISABLED

    Disables user input and changes the text input to grey/silver. This parameter is unreliable, and does not work in all browsers. It should not be relied upon.

  • ONFOCUS

    When the input receives focus.

  • ONBLUR

    When the input losses focus.

  • ONSELECT

    When the text or password has been selected ( highlighted ) by the user.

  • ONCHANGE

    When the input losses focus, but its value has changed since initial focus.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
  <HEAD>
    <TITLE>Document Title</TITLE>
    ... META DATA ...
  </HEAD>
  <BODY>
  <!-- Basic textarea input -->
  <TEXTAREA CLASS="userInput" NAME="message" ROWS="6" COLS="20"></TEXTAREA>
  <!-- Phrase "Show a default message here." appears inside box -->
  <TEXTAREA CLASS="userInput" NAME="message" ROWS="6" COLS="20">Show a default message here.</TEXTAREA>
  </BODY>
</HTML>

Move on to the Next Topic - Option Form Selector.