Tobago Demo

Menu

Textarea

The <tc:textarea/> tag, creates a textfield with one or more rows. The textarea becomes scrollable if the containing text could not displayed in the current size.

Tag Library Documentation

Basics

The textarea should always have a label attached. For this, use the label attribute.

Unlike the input field In there is no placeholder attribute to describe the meaning of a textarea, when no label is set.

<tc:textarea label="Text Area" value="Some text, some text, ..."/>

Focus

The following textarea should be selected after reloading this page. Use the focus attribute.

<tc:textarea label="Text Area (focus)" focus="true" value="Some Text"/>

Required

A textarea can be set as required with the required attribute. Such a textarea must contain a value, otherwise a submit is not possible. Leave the field blank and press 'submit' to see the errormessage.

<tc:textarea id="treq" label="Text Area" required="true"/>

Markups

The size can be changed with markup large or small.

Autocomplete

The autocomplete attribute can be used for explaining a user the meaning of a field.

The values are documented in MDN.

Ajax

Ajax update by the change event:

Rows

With the rows attribute, the initial size of the textbox can be set. A value less than 1 has no effect.

The following example show a textarea with five rows.

<tc:textarea label="Text Area" rows="5" value="#{textareaController.longText}"/>
© 2005-2023 Apache Software Foundation, Licensed under the Apache License, Version 2.0.