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"
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" />
Additional Parameters
rows: ThisĀ is the height of the visible text area in lines.
cols: This is the width of the visible text area in characters.
maxlength: It limits the number of characters that may be entered in the text area.
charcounter: It displays number of characters entered and number of characters remaining. It is used along with the maxlength attribute.
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" />