(Quick Reference)
textArea
Purpose
Creates a HTML text area element. An implicit "id" attribute is given the same value as name unless you explicitly specify one. All the usual HTML elements apply beyond the below:
Examples
<g:textArea name="myField" value="myValue" rows="5" cols="40"/>
Description
Attributes
name (required) - The name of the text area
value (optional) - The initial text to display in the text area. By default the text area will be empty.
escapeHtml (optional) - Sets whether the given value will be encoded as HTML or not. Default value is true.
Source
Show Source
def textArea = { attrs, body ->
resolveAttributes(attrs)
attrs.id = attrs.id ?: attrs.name
// Pull out the value to use as content not attrib
def value = attrs.remove('value')
if (!value) {
value = body()
} boolean escapeHtml = true
if (attrs.escapeHtml) escapeHtml = Boolean.valueOf(attrs.remove('escapeHtml')) out << "<textarea "
outputAttributes(attrs)
out << ">" << (escapeHtml ? value.encodeAsHTML() : value) << "</textarea>"
}