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
to perform the following steps:
Locate the file
mysite.module
and open it in an editor.Scroll down to the bottom and add the following function:
/** * Implementation of hook_form_alter(). */ function mysite_form_alter(&$form, &$form_state...