Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 299191

Issues with "required, multiple" fields in forms

$
0
0

Problem/Motivation

The textfield input for "user field" is #required, but has no label (the label is held by the table header) and thus shouldn't have a lone red asterisk. Seven correctly omits the marker if the label is empty.
Example of a form 'multiple, required' field form Bartik :

user_registration_form.png

Seen in #501408: Display user fields on registration form, but is also visible in current HEAD when editing an existing user account with fields.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue categoryBug because the information of the field being required should not appear twice
Issue priorityMajor because tim.plunkett said so ;)
Unfrozen changesUnfrozen because it only changes markup on fields widget that are set as required and allowing multiple values.
Prioritized changesThe main goal of this issue is usability and accessibility. Usability by hiding a non-pertinent mark near the input field. Accessibility by providing a valuable label for the multiple input fields.
DisruptionThis change could be disruptive for themes because it forces some form labels to be hidden.

Proposed resolution

For these cases mark the title_display as hidden:
'#title_display' => 'invisible',

Remaining tasks

Contributor tasks needed
TaskNovice task?Contributor instructionsComplete?
Create a patchInstructionsDone
Reroll the patch if it no longer applies.NoviceInstructionsDone
Update the issue summaryInstructionsDone
Update the issue summary noting if allowed during the betaInstructionsDone
Add automated testsInstructionsDone
Manually test the patch NoviceInstructionsDone
Embed before and after screenshots in the issue summary NoviceInstructionsDone
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standardsInstructions

User interface changes

Yes, the red asterisk moves to the correct location AND accessibility is enhanced by a better label around the fields.

Before :

<h4 class="label form-required">My unlimited required field label</h4>
[...]<label for="edit-field-unlimited-0-value" class="form-required"></label>

After :

<h4 class="label form-required">My unlimited required field label</h4>
[...]<label for="edit-field-unlimited-0-value" class="visually-hidden form-required">My unlimited required field label (value 1)</label>

API changes

n/a


Viewing all articles
Browse latest Browse all 299191

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>