Documentation · ViewHelper reference

Form / TextareaViewHelper


Textarea view helper.
The value of the text area needs to be set via the "value" attribute, as with all other form ViewHelpers.

Examples

Example

<f:form.textarea name="myTextArea" value="This is shown inside the textarea" />

Output



  • Tag usage example

    <f:form.textarea additionalAttributes="{foo: 'bar'}" data="{foo: 'bar'}" name="NULL" value="[mixed]" property="NULL" autofocus="NULL" rows="[anySimpleType]" cols="[anySimpleType]" disabled="NULL" placeholder="NULL" errorClass="'f3-form-error'" class="NULL" dir="NULL" id="NULL" lang="NULL" style="NULL" title="NULL" accesskey="NULL" tabindex="123" onclick="NULL">
    	<!-- tag content - may be ignored! -->
    </f:form.textarea>
  • Inline usage example

    {f:form.textarea(additionalAttributes: {foo: 'bar'}, data: {foo: 'bar'}, name: 'NULL', value: [mixed], property: 'NULL', autofocus: 'NULL', rows: [anySimpleType], cols: [anySimpleType], disabled: 'NULL', placeholder: 'NULL', errorClass: ''f3-form-error'', class: 'NULL', dir: 'NULL', id: 'NULL', lang: 'NULL', style: 'NULL', title: 'NULL', accesskey: 'NULL', tabindex: 123, onclick: 'NULL')}

Arguments

Argument Description Type
accesskey

Keyboard shortcut to access this element

string
additionalAttributes

Additional tag attributes. They will be added directly to the resulting HTML tag.

array
autofocus

Specifies that a text area should automatically get focus when the page loads

string
class

CSS class(es) for this element

string
cols

The number of columns of a text area

anySimpleType
data

Additional data-* attributes. They will each be added with a "data-" prefix.

array
dir

Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

string
disabled

Specifies that the input element should be disabled when the page loads

string
errorClass

CSS class to set if there are errors for this view helper

string
id

Unique (in this file) identifier for this HTML element.

string
lang

Language for this element. Use short names specified in RFC 1766

string
name

Name of input tag

string
onclick

JavaScript evaluated for the onclick event

string
placeholder

The placeholder of the textarea

string
property

Name of Object Property. If used in conjunction with , "name" and "value" properties will be ignored.

string
rows

The number of rows of a text area

anySimpleType
style

Individual CSS styles for this element

string
tabindex

Specifies the tab order of this element

integer
title

Tooltip text of element

string
value

Value of input tag

mixed
Required attribute

Revision history

commit 3ef7ac06f12356785e7d8887b847fd010a886826
Author: Sebastian Kurfürst <*****@typo3.org>
Date:   Tue Mar 31 11:49:37 2009 +0000

    Fluid:
    * Added Form* view helpers backported from v5
    * Adjusted view helpers to refactoring of URIHelper

commit 1f66f4e25f1f8a371ac8ecf79fbfd035c9c37c6d
Author: Jochen Rau <*****@web.de>
Date:   Wed Apr 8 22:35:15 2009 +0000

    Fluid:
    * Fixed a problem when the name of a form element tag came from $arguments['property]
    * Added tag attributes "rows" and "cols" to form.textarea

commit 38ebcedd944471b83d9293b648264fd3e65634f1
Author: Bastian Waidelich <*****@typo3.org>
Date:   Tue May 5 20:52:33 2009 +0000

    Fluid:
    * Changes backported from FLOW3:
      * major cleanup and refactoring of core and view helper classes & comments
      * added validation for boolean arguments in AbstractViewHelper
      * added initialize-method to AbstractViewHelper, that is called before render(). This was especially needed for tagbased viewhelpers.
      * renderChildren() now directly calls evaluateChildNodes() on the respective view helper node allowing us to render objects/arrays.
      * improved boolean type conversion for arguments in ViewHelperNode.
      * added TagBuilder class, re-wrote all tag based view helpers to use it (see form view helpers for some examples)
      * ViewHelperArguments collection got a new method "hasArgument()" that returns TRUE when the specified argument exists and is not NULL
    * tx_fluid changes:
      * Improved fake object factory. Now objects are injected to subclasses and implementations of the specified classes/interfaces.
      * cleaned up and tweaked view helpers. Removed Parsefunc, Stdwrap and TypoScript view helpers for now. Added CObject, If/Then/Else, EmailLink, Crop, Currency, Debug, HTML, Nl2br, Image view helpers. Thanks to Sebastian Böttger, Christopher Hlubek, Niels Pardon, Andreas Pattynama for the help!
    * Note: Unit tests not fully backported yet.

commit 27bbf6507db26ae9d53054ce908df203beefc3c8
Author: Bastian Waidelich <*****@typo3.org>
Date:   Sat May 16 18:43:53 2009 +0000

    tx_fluid:
     * !!!changed view helpers once again!!! link view helpers reside in the link subfolder now. For each link view helper there is a corresponding uri helper now. Check out https://svn.typo3.org/TYPO3v4/CoreProjects/MVC/viewhelpertest for a working example.
     * TagBuilder->setContent does not apply htmlspecialchar() on the the tag contents, as that does not really makes sense - if you really need to escape tag contents, you gotta do it yourself now.

commit 50af6b9c08d04e3e1d4ce56a499a9a3d4b84efc3
Author: Sebastian Kurfürst <*****@typo3.org>
Date:   Thu May 28 21:45:46 2009 +0000

    Fluid:
    * Backported major changes from Fluid v5 to Fluid v4
    * !!! Many of these changes are not backwards-compatible! Please read this if you have written custom ViewHelpers!
    * Introduced Shorthand Syntax for calling ViewHelpers
    * Core:
    ** Lots of internal cleanup and refactorings.
    ** !!! Complete restructuring into subpackages.
    * ViewHelpers:
    ** !!! The base classes of ViewHelpers changed to Tx_Fluid_Core_ViewHelper_AbstractViewHelper and Tx_Fluid_Core_ViewHelper_TagBasedViewHelper. Please adjust your ViewHelpers!
    ** !!! $this->variableContainer has been renamed to $this->templateVariableContainer
    ** !!! the view is not in $this->variableContainer anymore. Currently there is no way to fetch the View from a ViewHelper.
    ** Introduced a new $this->controllerContext containing the context variables of the controller
    ** !!! The request can be now found in $this->controllerContext->getRequest()
    ** !!! The URIHelper has been renamed to URIBuilder and can be now found in $this->controllerContext->getURIBuilder()
    ** Introduced a new ViewHelperVariableContainer, available in $this->viewHelperVariableContainer to pass data between ViewHelpers. Should only be needed in very rare cases.
    ** !!! Removed <f:format.htmlEscape> ViewHelper! Please remove these declarations in your template! Escaping of object accessors is now automatically done, see next point.
    * !!! ObjectAccessors {...} are now automatically HTMLspecialChar'd if not used as an argument to a ViewHelper. This is done using a new ObjectAccessorPostProcessor. Lateron, this will be made configurable.

commit 785ba07f9c52130d0e2d94f78aea45bbfbe6d20c
Author: Sebastian Kurfürst <*****@typo3.org>
Date:   Mon Aug 3 10:52:32 2009 +0000

    [+BUGFIX] Fluid (View): Refactored TemplateView, which is now automatically backported to FLOW3
    [+FEATURE] Fluid: Added Layout and Partial support. This adds <f:render>, <f:layout> and <f:section> as ViewHelpers. See the blog example for an example.
    [!!!] [~TASK] Fluid (ViewHelpers): Updated AbstractFormViewHelper and SelectViewHelper. Everything should still work as expected, but here there might still be some issues. Please test thoroughly and report any problems!

commit 4467e66b6f9df90664c36477ef07a4d99fbae3d0
Author: Jochen Rau <*****@web.de>
Date:   Mon Aug 10 23:37:02 2009 +0000

    [~FEATURE] Fluid (ViewHelpers): Adjusted AbstractFormViewHelper to be able to namespace arguments. Fixed several Unit Tests. The patch was provided by Bastian. Thanks a lot! Resolves #3317.

commit c2898a434a24fbd3303609798dcfc16c01b9197a
Author: Sebastian Kurfürst <*****@typo3.org>
Date:   Wed Sep 16 10:06:17 2009 +0000

    [+FEATURE] Fluid (ViewHelpers): Added a PaddingViewHelper
    [+FEATURE] Fluid (ViewHelpers): Added a RenderFlashMessages ViewHelper
    [TASK] Fluid (Core): Added a PaddingViewHelper
    [TASK] Fluid (Core): Added an exception if ViewHelpers declare an argument multiple times.

commit 360c781d1ac4e300f22d713a1926a9af7e4fa835
Author: Sebastian Kurfürst <*****@typo3.org>
Date:   Mon Oct 12 06:23:39 2009 +0000

    [+FEATURE] tx_fluid (ViewHelpers): Prepared ViewHelpers for Request Hash (HMAC) generation. Relates to #4960.
    [+FEATURE] tx_fluid (Core): Implemented editing of properties for nested objects in forms. Resolves #3702.
    [+TASK] tx_fluid: Backported everything which results in comment-changes and some formatting changes.

commit 9b2830bc1c17588dd69a463773c5f05f61b5cf94
Author: Sebastian Kurfürst <*****@typo3.org>
Date:   Sat Oct 24 11:01:38 2009 +0000

    * A*****@api annotations
    * Changed the fluid-specific RuntimeException to SPL's RuntimeException.

commit 7868047c52417ff4e1f3e99e45adaba1ee3d0a24
Author: Sebastian Kurfürst <*****@typo3.org>
Date:   Sat Oct 24 11:49:45 2009 +0000

    [~TASK] Fluid: A*****@package and @subpackage annotations.

commit 06372a84a645147029501d2b2b06a4fdfe56b7d7
Author: Michael Stucki <*****@typo3.org>
Date:   Wed Nov 25 21:53:57 2009 +0000

    Add missing SVN properties for new or modified files

commit ed19fe9e4a6d2e91c594784adea24aa82064dd47
Author: Sebastian Kurfürst <*****@typo3.org>
Date:   Mon Jul 12 20:18:26 2010 +0000

    Fluid in v5 and v4 are now synchronized again!
    
    [+FEATURE] Fluid: The TemplateVariableContainer now provides a method to retrieve all variables.
    [~TASK] Fluid (Core): Introduced a RenderingContextInterface to more cleanly decouple Fluid's rendering context from the TypoScript rendering context. Note that view helpers (and other code) should now refer to that interface instead of the concrete Fluid implementation!
    [!!!][+BUGFIX] Fluid (Core): Refactored all Condition-ViewHelpers like f:if, f:security.if* to use a newly created base class F3\Fluid\Core\ViewHelper\ConditionViewHelper. This greatly simplifies the implementation of custom conditions. However, THIS IS A BREAKING CHANGE in case you copied the f:if ViewHelper to create a custom condition ViewHelper, as the internal workings changed. Please check the new f:if ViewHelper to see how to adjust your ViewHelper -- you basically just have to throw away a lot of code. Resolves #8824.
    [!!!][-API] Fluid (TemplateView): Removed renderSection() and renderWithLayout() from public API in Tx_Fluid_View_TemplateView, as this should only be called from inside Fluid.
    [!!!][TASK] Fluid (ViewHelpers): the <f:section />-ViewHelper now does NOT render itself anymore when encountered in a normal template. Example: Before the change, the template "before <f:section name='...'> middle </f:section> after" was rendered as "before middle after", but now it is only rendered as "before after". Although this is a breaking change, it is quite unlikely that anybody relied on this behavior, as it was inconsistent beforehand.
    [TASK] Fluid (TemplateView): Major refactoring of the layout, partial and section rendering mechanism. This also induces a speedup as retundant rendering is eliminated.
    [+FEATURE] Fluid (ViewHelpers): The <f:render>-ViewHelper can be now used to render sections in the same partial and template. In these cases, all arguments need to be specified explicitely. Additionally, it can now be used to render a section recursively.
    [~TASK] Fluid (Core): Removed some non-API-methods which were never called.

commit 186bdaeac89820779f91853b830cc95d60c7ad58
Author: Bastian Waidelich <*****@typo3.org>
Date:   Tue Jul 13 09:42:26 2010 +0000

    [-TASK] Fluid: R*****@version annotation from all Fluid classes to ease the backporting process. Relates to #8835 (backported from Fluid package)

commit 1d36de6ed90007e324b773782e8f0a1d1c1191a2
Author: Bastian Waidelich <*****@typo3.org>
Date:   Tue Jul 13 10:12:30 2010 +0000

    [-TASK] Fluid: R*****@package/@subpackage annotations from all Fluid classes. They have already been removed in FLOW3 packages in r2813.

commit 489e8942f7c62323d66b35d9b7242010dddaf808
Author: Sebastian Kurfürst <*****@typo3.org>
Date:   Mon Jul 26 13:31:14 2010 +0000

    [+BUGFIX] Fluid (ViewHelpers): Fixed a possible security issue where the content inside the Fluid a is not properly HTML escaped.

commit 472451987ca0530fa5828bb0b79fcafa2f905a35
Author: Bastian Waidelich <*****@typo3.org>
Date:   Fri Nov 19 20:58:09 2010 +0000

    [-TASK] Fluid: R*****@scope annotations as they are not used in v4

commit dd8928aed4c119d8db37322acb91ded24ba5cc35
Author: Bastian Waidelich <*****@typo3.org>
Date:   Thu Dec 30 16:21:11 2010 +0000

    [+TASK] Fluid (ViewHelpers): Fix, cleanup and extend inline documentation of ViewHelpers
    
    Resolves #10908

commit fd09d197fa8886b97cb20aa9573f39cd08ce989e
Author: Bastian Waidelich <*****@typo3.org>
Date:   Thu Nov 10 18:27:58 2011 +0100

    [TASK] S*****@author annotations
    
    This backports three recent changes of the TYPO3.Fluid package:
    - R*****@license annotation from files (290f4f5)
    - Simplify license header in PHP files (14bacba)
    - D*****@author tags from source code (9c2e837)
    
    This should not contain any functional change!
    
    Change-Id: I9376dca4af78c4f0f82413011d115b8ad04634dd

commit ec3891d8d4e339d8319428211207e6201be9fd73
Author: Thomas Maroschik <*****@dfau.de>
Date:   Wed Oct 17 21:18:26 2012 +0200

    [TASK][WIP] Move non class code back to source files
    
    Change-Id: I620d2e61860142cdc89cc83474c95542799961c0

commit 554e8f890dcc0dd86a27518b58e2b54be26fd37e
Author: Thomas Maroschik <*****@dfau.de>
Date:   Wed Oct 17 22:20:17 2012 +0200

    [TASK] Namespace classes
    
    Change-Id: Ia7432e1c923826ed58206bca15fb94509adbd508

commit b97e2be01be77a8ee5abd478314a09d6435040a2
Author: Markus Günther <*****@markus-guenther.de>
Date:   Sun Nov 18 14:19:15 2012 +0100

    [BUGFIX] make cols and rows in TextareaViewHelper optional
    
    When using the Tx_Fluid_ViewHelpers_Form_TextareaViewHelper to render
    a <textarea> Element you must provide "cols" and "rows", which should
    be optional attributes instead. Nowadays you should rather use CSS
    to set the dimensions of any HTML Element.
    
    Resolves: #13255
    Release: 6.0
    
    Change-Id: Ia77ab8221866f504af64e76d77269bf88a312577
    Reviewed-on: http://review.typo3.org/16556
    Reviewed-by: Wouter Wolters
    Tested-by: Wouter Wolters
    Reviewed-by: Anja Leichsenring
    Tested-by: Anja Leichsenring
    Reviewed-by: Alexander Schnitzler
    Tested-by: Alexander Schnitzler

commit 9d13dedf017b614b834261b1bf5d4acb2201f1d4
Author: Alexander Schnitzler <*****@typovision.de>
Date:   Fri Nov 16 19:49:02 2012 +0100

    [CLEANUP] Replace FLOW3 with TYPO3 Flow
    
    Releases: 6.0
    Fixes: #43036
    Change-Id: I62df23587301b4cde3ddeae3686b34f54fe1182e
    Reviewed-on: http://review.typo3.org/16498
    Reviewed-by: Alexander Schnitzler
    Tested-by: Alexander Schnitzler

commit f509c210524ad6414172aa1c590e64c2e3c02c0e
Author: Alexander Schnitzler <*****@typovision.de>
Date:   Mon Nov 19 16:41:00 2012 +0100

    [BUGFIX] Remove newlines after closing php tag
    
    Releases: 6.0
    Fixes: #43105
    Change-Id: Icd787d943e236d835ab51f84e5226bbdbefacc6c
    Reviewed-on: http://review.typo3.org/16568
    Reviewed-by: Alexander Schnitzler
    Tested-by: Alexander Schnitzler

commit 9d46e6932d35c79bf87c96fa38b8e537c4192f23
Author: Alexander Schnitzler <*****@typovision.de>
Date:   Tue Nov 20 16:27:02 2012 +0100

    [CLEANUP] Adjust code to CGL and fix small namespace bugs
    
    * whitespaces, tabs and blank line issues
    * bool -> boolean
    * int -> integer
    * fix wrong namespace annotations
    
    Fixes: #43157
    Releases: 6.0
    Change-Id: I8397948e19248db029d8efd1555ee56e4982742d
    Reviewed-on: http://review.typo3.org/16619
    Reviewed-by: Helmut Hummel
    Tested-by: Helmut Hummel

commit 50d433bbde06b4b9eab146caea64d09239949e64
Author: Tymoteusz Motylewski <*****@gmail.com>
Date:   Sun Mar 3 18:53:42 2013 +0100

    [TASK] Sync CMS Fluid with Flow Fluid 1.1 (part2)
    
    This is the second part of a backport fluid from Flow.
    
    Change-Id: I96e47131414c50801ff7628508dc05d7d7b5e106
    Releases: 6.1
    Resolves: #44819
    Fixes: #45985
    Reviewed-on: https://review.typo3.org/18163
    Reviewed-by: Wouter Wolters
    Tested-by: Wouter Wolters
    Reviewed-by: Marc Bastian Heinrichs
    Tested-by: Marc Bastian Heinrichs

commit 745e6a6517967c0b2344e9dd0f764d37d3071e76
Author: Wouter Wolters <*****@wouterwolters.nl>
Date:   Sun Apr 28 23:44:28 2013 +0200

    [FEATURE] Add placeholder argument to VH for Textarea and Textfield
    
    Change-Id: I8c4cc22e10ce2991f48c32b7934bf01346f8aecf
    Resolves: #45960
    Releases: 6.2
    Reviewed-on: https://review.typo3.org/20281
    Reviewed-by: Wouter Wolters
    Tested-by: Wouter Wolters
    Reviewed-by: Helmut Hummel
    Reviewed-by: Stefan Neufeind
    Tested-by: Stefan Neufeind

commit e6e0b4f1488671a2cf69940d1287bd5ddd363947
Author: Tim Spiekerkoetter <*****@hdnet.de>
Date:   Sat Jul 6 12:35:35 2013 +0200

    [FEATURE] Added autofocus attribute to textfield and textarea
    
    The ViewHelpers f:form.textfield and f:form.textarea were lacking the
    HTML5 "autofocus" attribute. It is available for button, input and
    textarea. Now Fluid reflects this correctly by adding this attribute to
    the initializeArguments methods for TextareaViewHelper and
    TextfieldViewHelper.
    
    Resolves: #48689
    Releases: 6.2
    Change-Id: I00480dc4e76b2854dc0be36d150d32c7b432d93d
    Reviewed-on: https://review.typo3.org/21994
    Reviewed-by: Wouter Wolters
    Tested-by: Wouter Wolters
    Reviewed-by: Christian Kuhn
    Tested-by: Christian Kuhn

commit 77f29a3c69a7cbb27b34072754aa503bace6c9f1
Author: Christian Kuhn <*****@schwarzbu.ch>
Date:   Tue Oct 1 14:40:56 2013 +0200

    [TASK] Remove closing PHP tags
    
    Change-Id: Iaa92566c53301e49396fc9fb26b0b339c48d567b
    Resolves: #52360
    Releases: 6.2
    Reviewed-on: https://review.typo3.org/24212
    Reviewed-by: Christian Kuhn
    Tested-by: Christian Kuhn
    Reviewed-by: Ernesto Baschny
    Tested-by: Ernesto Baschny
    Reviewed-by: Anja Leichsenring
    Tested-by: Anja Leichsenring