form_textarea

Versions
4.6
form_textarea($title, $name, $value, $cols, $rows, $description = NULL, $attributes = NULL, $required = FALSE)

Format a multiple-line text field.

Parameters

$title The label for the text field.

$name The internal name used to refer to the field.

$value The initial value for the field at page load time.

$cols The width of the field, in columns of text.

$rows The height of the field, in rows of text.

$description Explanatory text to display after the form item.

$attributes An associative array of HTML attributes to add to the form item.

$required Whether the user must enter some text in the field.

Return value

A themed HTML string representing the field.

Related topics

▾ 25 functions call form_textarea()

aggregator_form_category in modules/aggregator.module
block_admin_configure in modules/block.module
Menu callback; displays the block configuration form.
block_box_form in modules/block.module
blog_form in modules/blog.module
Implementation of hook_form().
book_form in modules/book.module
Implementation of hook_form().
comment_admin_edit in modules/comment.module
Menu callback; edit a comment from the administrative interface.
comment_user in modules/comment.module
Implementation of hook_user().
contact_mail_user in modules/contact.module
forum_form in modules/forum.module
Implementation of hook_form().
forum_form_container in modules/forum.module
Returns a form for adding a container to the forum vocabulary
forum_form_forum in modules/forum.module
Returns a form for adding a forum to the forum vocabulary
hook_user in developer/hooks/core.php
Act on user account actions.
node_example_form in developer/examples/node_example.module
Implementation of hook_form().
node_types_configure in modules/node.module
Menu callback; presents each node type configuration page.
page_form in modules/page.module
Implementation of hook_form().
profile_form_profile in modules/profile.module
story_form in modules/story.module
Implementation of hook_form().
system_theme_settings in modules/system.module
Menu callback; display theme configuration for entire site and individual themes.
system_view_general in modules/system.module
taxonomy_form_term in modules/taxonomy.module
taxonomy_form_vocabulary in modules/taxonomy.module
theme_comment_form in modules/comment.module
user_configure_settings in modules/user.module
_locale_string_edit in includes/locale.inc
User interface for string editing
_profile_field_form in modules/profile.module

Code

includes/common.inc, line 1276

<?php
function form_textarea($title, $name, $value, $cols, $rows, $description = NULL, $attributes = NULL, $required = FALSE) {
  $pre = '';
  $post = '';

  // optionally plug in a WYSIWYG editor
  foreach (module_list() as $module_name) {
    if (module_hook($module_name, 'textarea')) {
      $pre  .= module_invoke($module_name, 'textarea', 'pre', $name);
      $post .= module_invoke($module_name, 'textarea', 'post', $name);
    }
  }

  return theme('form_element', $title, $pre .'<textarea wrap="virtual" cols="'. check_plain($cols) .'" rows="'. check_plain($rows) .'" name="edit['. $name .']" id="edit-'. $name .'" class="'. _form_get_class('textarea', $required, _form_get_error($name)) .'"'. drupal_attributes($attributes) .'>'. check_plain($value) .'</textarea>'. $post, $description, 'edit-'. $name, $required, _form_get_error($name));
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.