Textarea
Supported products
- Central CMS
- Central Forms
- Central Connect
Generates a textarea with options to control the number of rows (the height) of the element as well as additional help and guidance information.
info
A textarea will default to two rows in height to differentiate themselves from regular text inputs.
Basic usage
- Twig
- HTML
{{
form.textarea({
'label': 'My label',
'id': 'guid-' ~ random(),
'name': 'textarea-1'
})
}}
<div class="form__group">
<label for="guid-1002650137" class="control__label">My label</label>
<div class="controls">
<textarea id="guid-1002650137" name="textarea-1" class="form__control textarea"></textarea>
</div>
</div>
Helper options
You can configure this helper using the common helper options. The following options are specific to this helper.
Option | Type | Description |
---|---|---|
readonly | bool | Adds readonly attribute and uses a dashed outline to indicate lack of interaction |
rows | integer | The number of horizontal rows of text used to control the height of the input (default 2) |
Rows
The height of a textarea can be increased by defining a number of rows
that suits your expected input. If you expect a lot of content, provide more rows.
- Twig
- HTML
{{
form.textarea({
'label': 'My label',
'id': 'guid-' ~ random(),
'name': 'textarea-3',
'rows': 5
})
}}
<div class="form__group">
<label for="guid-1729276651" class="control__label">My label</label>
<div class="controls">
<textarea id="guid-1729276651" name="textarea-3" rows="5" class="form__control textarea"></textarea>
</div>
</div>