1.16.x form.inc theme_textarea($variables)
1.18.x form.inc theme_textarea($variables)
1.17.x form.inc theme_textarea($variables)

Returns HTML for a textarea form element.


$variables: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #title, #value, #description, #rows, #cols, #placeholder, #required, #attributes

Related topics


includes/form.inc, line 4583
Functions for form and batch generation and processing.


function theme_textarea($variables) {
  $element = $variables['element'];
  element_set_attributes($element, array('id', 'name', 'rows', 'cols', 'placeholder'));
  _form_set_class($element, array('form-textarea'));

  $wrapper_attributes = array(
    'class' => array('form-textarea-wrapper'),

  // Add resizable behavior.
  if (!empty($element['#resizable'])) {
    backdrop_add_library('system', 'backdrop.textarea');
    $wrapper_attributes['class'][] = 'resizable';

  $output = '<div' . backdrop_attributes($wrapper_attributes) . '>';
  $output .= '<textarea' . backdrop_attributes($element['#attributes']) . '>' . check_plain($element['#value']) . '</textarea>';
  $output .= '</div>';
  return $output;