For Adobe ColdFusion application servers TextArea

A textarea format field is the equivalent of the <textarea> tag, a multi-line box into which the visitor can type text. This text would usually be a character string. textarea also features an optional character counter, which providesfeedback about how much more input is allowed. See below for an example. If the TerraField attribute Prompt is specified, the value will appear in the empty field and disappear as soon as the field received focus.

The following special attributes are available for textarea:

  • Counter
    Optional. Boolean, defaults to true. Display the character counter? (Requires a maximum length to be specified using the maxlength attribute.)
  • CounterCaption
    Optional. An HTML caption that appears next to the character counter.

The form below shows examples of a plain field, a field with a default value, a field with regular attributes specified, a field with a prompt message, and a field with a character counter. Note that many other TerraField attributes can be specified, such as minlength, pattern, and datatype.

Other non-TerraField attributes will be passed through to the underlying textarea tag (<textarea>). For example:

  • onchange="alert(this.value.length + ' character(s)')"
  • cols="30"
  • rows="6"
  • wrap="off"

Examples

A plain textarea field:

<cf_terrafield
  name="MyTextAreaField1"
  format="textarea"
/>


Assign a default value:

<cf_terrafield
  name="MyTextAreaField2"
  format="textarea"
  default="All you need in this life is
  ignorance and confidence, and then
  success is sure."
/>

Regular attributes are passed through:

<cf_terrafield
  name="MyTextAreaField3"
  format="textarea"
  cols="20"
  rows="5"
  style="background-color : ##cccccc;"
/>

Add a prompt message:

<cf_terrafield
  name="MyTextAreaField4"
  format="textarea"
  prompt="Your message"
/>

To turn on the character counter, set Counter to true (this is the default) and provide a maximum length. If you want to create a field with a maximum length but without a counter, then set Counter to false.

<cf_terrafield
  name="MyTextAreaField5"
  format="textarea"
  prompt="Your message"
  maxlength="250"
/>

Characters remaining:

HyperText Markup Language
The coding language used to create hypertext documents for use on the World Wide Web.
No comments yet