# 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 value of the text area

## Source

Show Source

    def textArea = {attrs, body ->
            resolveAttributes(attrs)
            attrs.id = 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()
            }        def escapeHtml = true
            if (attrs.escapeHtml) escapeHtml = Boolean.valueOf(attrs.remove('escapeHtml'))        out << "<textarea "
            outputAttributes(attrs)
            out << ">" << (escapeHtml ? value.encodeAsHTML() : value) << "</textarea>"
        }