Joomla textarea Form Field Type

The textarea form field type provides a text area for entry of multi-line text.

XML Field Definition

<field 
name="mytextarea"
type="textarea"
default="default"
label="Enter some text"
description=""
rows="10"
cols="5" />

Use the raw filter to ensure that html code is preserved when the form is processed.

<field 
name="mytextarea"
type="textarea"
default="default"
label="Enter some html"
description=""
rows="10"
cols="5"
filter="raw" />

Mandatory Parameters

  1. type - must be textarea.
  2. name - is the unique name of the field.
  3. label - (translatable) is the descriptive title of the field.

Optional Parameters

  1. rows - is the height of the visible text area in lines.
  2. cols - is the width of the visible text area in characters.
  3. default - (not translatable) is the default value.
  4. description - (translatable) is the help text.
  5. class - is a CSS class name for the HTML form field.
  6. filter - allow the system to save certain html tags or raw data.
  7. hint - The text displayed in the html placeholder element.
  8. maxlength - Limits the number of characters that may be entered.
  9. charcounter - Displays number of characters entered and number of characters remaining. It is used along with maxlength.

Examples

1. Meta Description Field (com_content)

<field
name="metadesc"
type="textarea"
label="JFIELD_META_DESCRIPTION_LABEL"
rows="3"
cols="30"
maxlength="160"
charcounter="true" />

2. Offline Message Field (Global Configuration)

<field
name="offline_message"
type="textarea"
label="COM_CONFIG_FIELD_OFFLINE_MESSAGE_LABEL"
filter="safehtml"
cols="60"
rows="2"
showon="offline:1[AND]display_offline_message:1" />