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
- type - must be textarea.
- name - is the unique name of the field.
- label - (translatable) is the descriptive title of the field.
Optional Parameters
- rows - is the height of the visible text area in lines.
- cols - is the width of the visible text area in characters.
- default - (not translatable) is the default value.
- description - (translatable) is the help text.
- class - is a CSS class name for the HTML form field.
- filter - allow the system to save certain html tags or raw data.
- hint - The text displayed in the html placeholder element.
- maxlength - Limits the number of characters that may be entered.
- 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" />