Change record status: 
Project: 
Introduced in branch: 
8.0.x
Introduced in version: 
Description: 

For short form fields it makes sense to have the #description appear below the form widget; however, in long lists of checkboxes and/or radio buttons it would be nice to be able to have a toggle whether the #description appears above, or below, the form widget.

The is a new "#description_display" option with three allowed values, consistent with '#title_display': "before", "after" and "invisible".

There is no UI in core for toggling this behavior for existing forms.

Example:

  public function buildForm(array $form, FormStateInterface $form_state) {
    $form['form_textfield_test_description_before'] = array(
      '#type' => 'textfield',
      '#title' => 'Textfield test for description before element',
      '#description' => 'Textfield test for description before element',
      '#description_display' => 'before',
    );

    $form['form_textfield_test_description_after'] = array(
      '#type' => 'textfield',
      '#title' => 'Textfield test for description after element',
      '#description' => 'Textfield test for description after element',
      '#description_display' => 'after',
    );

    $form['form_textfield_test_description_invisible'] = array(
      '#type' => 'textfield',
      '#title' => 'Textfield test for visually-hidden description',
      '#description' => 'Textfield test for visually-hidden description',
      '#description_display' => 'invisible',
    );

    return $form;
  }
Impacts: 
Module developers
Themers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done
Details: 
Progress: