O'Reilly logo

Drupal 6 Theming Cookbook by Karthik Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Changing the height of a textarea

Forms in Drupal are managed using the Form API and modified using hook_form_alter(). In this recipe, we will look at changing the default height, or to be more precise, the default number of rows of the textarea which represents the body field in a node form.

Getting ready

We will be using the mysite module created earlier in this book to contain the hook_form_alter().

How to do it...

Navigate to the mysite module folder at sites/all/modules/mysite to perform the following steps:

  1. Locate the file mysite.module and open it in an editor.
  2. Scroll down to the bottom and add the following function:
    /** * Implementation of hook_form_alter(). */ function mysite_form_alter(&$form, &$form_state, $form_id) { // dpm($form_id); // ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required