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

Turning off the resize feature for textareas

Textareas in Drupal are, by default, automatically resizable, thanks to some nifty JavaScript. They can be resized by clicking and dragging the grippie handle right below the element. This, while very handy, can sometimes cause problems when used in tandem with HTML editor scripts which customarily implement their own version of this feature.

In this recipe, we will look to use the Form API to disable the resizable option for a specific textarea—the body field of a typical node form.

Getting ready

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

How to do it...

Navigate to the mysite module folder at sites/all/modules/mysite ...

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