drupalform-api

Disable Drupal's textarea expander?


Similar to the question posting form on SO, Drupal adds a draggable expander to the bottom of textareas created through the form api. How can I disable this in a nice manner?


Solution

  • The draggable expander gets added via the behavior defined in 'misc/textearea.js'. From that you can see that it applies to textareas having a class 'resizable'. You can prevent the output of this class if you set the '#resizable' property on a textareas FAPI definition to FALSE (it defaults to TRUE if not explicitly set).

    So for your own forms, you can just declare the textareas accordingly. For other forms, youD need to adjust them via hook_form_alter().