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.
Although this can be themed with theme_form_element, it is difficult.
Some site builders ask clients to include their instructions for long form widgets in the "label" (#title) instead of the #description so that the instructions appear at the "right" end of the form.
Steps to reproduce
- make a module that has a form
- notice the description is after
'#description_display' => 'before'to the module
- notice your description in the form is now before
Add a form api option "description_display" which has three allowed values: before, after, invisible.
Keep the current behavior the default of the description being after
+ '#description_display' => 'after',
which all forms use.
"invisible" instead of "visually-hidden" is for consistency with the title_display property: https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.h...
This issue does NOT add a UI to core to expose the configurability per field.
|Task||Novice task?||Contributor instructions||Complete?|
|Update the issue summary||Instructions||done|
|Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standards||Instructions|
User interface changes
No changes. (but adds a way for things to change.)
Change to form api.
|#157||314385-nope-2.png||155.13 KB||Les Lim|
|#157||314385-nope.png||120.33 KB||Les Lim|
|PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 75,410 pass(es). |
[ View ]
|FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 75,237 pass(es), 2 fail(s), and 0 exception(s). |
[ View ]