Warning message

Documentation is currently being migrated into the new system. Some pages might be temporarily missing, and some guides might appear empty. Thank you for your patience while we are improving Drupal.org documentation.

HowTos

Move field's help text (description) between the label and input element(s)

Last updated on
November 1, 2016 - 16:31

A common problem with field types that takes up a lot of screen estate is that the help text disappears at the bottom and users won't notice it. The most obvious example of this is a text field with input format with more than 20 rows. Another example is a multi-value field with many added values. In cases like these, developers might want to make the help text more visible by moving it above the input element.

There are several solutions to this, and these can be grouped in two main types:

  • Solutions that move the field's existing help text from below to above the input area.
  • Solutions that add a new text setting which are put between the label and the input area

There is a third kind of solution which involves using JavaScript to manipulate the DOM, but this is considered a hack and is not included here.

Solutions using the existing field help text

These solutions will use the existing field help text and move it around in various ways.

  • Override theme_webform_element in your theme's template.php file. More info: Overriding themable output.
  • Form element layout. This lets you configure the position of the field's existing help text on a per field basis to be before or after the input element. It defaults to standard/core behavior. Developers can override the position in any form using the #description_display attribute.
  • Top Description. A minimalist sandbox module that will unconditionally move all form descriptions above the input element. Minimally maintained and maintenance fixes only.

Solutions with a new help text

These are modules that will add a new text setting for the field and inject it between the label and otherwise ignore the existing help text.

  • Label Help. Does not modify existing help text and this can be used as an additional help text.
  • Extra Field Description. Behaves exactly like Label Help, but it seems to be less maintained.
  • Better field descriptions. Like the two options above, it creates an additional field setting for the additional help text. However, this module extracts the configuration to a separate admin page with its own permission, thereby making it possible for users without the Administer site configurationpermission to edit the additional field help texts.