Actions

Difference between revisions of "Textarea form field type"

From Joomla! Documentation

(Created page for form field type)
 
m (Default value of Textarea field type is currently not translatable)
 
(3 intermediate revisions by 2 users not shown)
Line 10: Line 10:
 
* '''rows''' (mandatory) is the height of the visible text area in lines. If omitted the width is determined by the browser. The value of rows does not limit the number of lines that may be entered.
 
* '''rows''' (mandatory) is the height of the visible text area in lines. If omitted the width is determined by the browser. The value of rows does not limit the number of lines that may be entered.
 
* '''cols''' (mandatory) is the width of the visible text area in characters. If omitted the width is determined by the browser. The value of cols does not limit the number of characters that may be entered.
 
* '''cols''' (mandatory) is the width of the visible text area in characters. If omitted the width is determined by the browser. The value of cols does not limit the number of characters that may be entered.
* '''default''' (optional) (translatable) is the default value.
+
* '''default''' (optional) (not translatable) is the default value.
 
* '''description''' (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
 
* '''description''' (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
 
* '''class''' (optional)  is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.
 
* '''class''' (optional)  is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.
 +
* '''filter''' (optional) allow the system to save certain html tags or raw data.
  
 
Example XML field definition:  
 
Example XML field definition:  
 
<source lang="xml"><field name="mytextarea" type="textarea" default="default" label="Enter some text" description="" rows="10" cols="5" /></source>
 
<source lang="xml"><field name="mytextarea" type="textarea" default="default" label="Enter some text" description="" rows="10" cols="5" /></source>
 +
Use the raw filter to ensure that html code is preserved when the form is processed:
 +
<source lang="xml"><field name="mytextarea" type="textarea" default="default" label="Enter some html" description="" rows="10" cols="5" filter="raw"/></source>
 
<noinclude>
 
<noinclude>
 
=== Tips ===
 
=== Tips ===
 
* If you need to line break just encode <code>&lt;br /&gt;</code> in the XML config file like this: <code>&amp;lt;br /&amp;gt;</code>
 
* If you need to line break just encode <code>&lt;br /&gt;</code> in the XML config file like this: <code>&amp;lt;br /&amp;gt;</code>
 +
* If you need a new line character in your default value, add <code>&amp;#13;&amp;#10;</code> to the default parameter
 +
 
=== See also ===
 
=== See also ===
 
* [[Text form field type]]
 
* [[Text form field type]]
 
* [[Standard form field types|List of standard form field types]]
 
* [[Standard form field types|List of standard form field types]]
 
[[Category:Standard form field types]]</noinclude>
 
[[Category:Standard form field types]]</noinclude>

Latest revision as of 14:22, 25 March 2012

Params.textarea.jpg

The textarea form field type provides a text area for entry of multi-line text. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.

  • type (mandatory) must be textarea.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • rows (mandatory) is the height of the visible text area in lines. If omitted the width is determined by the browser. The value of rows does not limit the number of lines that may be entered.
  • cols (mandatory) is the width of the visible text area in characters. If omitted the width is determined by the browser. The value of cols does not limit the number of characters that may be entered.
  • default (optional) (not translatable) is the default value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.
  • filter (optional) allow the system to save certain html tags or raw data.

Example 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"/>

Tips

  • If you need to line break just encode <br /> in the XML config file like this: &lt;br /&gt;
  • If you need a new line character in your default value, add &#13;&#10; to the default parameter

See also