Problem/Motivation
During the usability review of #3459246: Add a '#check_all' option for checkboxes element (#3471604: Drupal Usability Meeting 2024-09-06 - attendees were @benjifisher, @rkoller, @simohell, and @worldlinemine) we've noticed one detail while going through the test case. List fields have the option Check boxes / radio buttons as one of the options on their form display widget. But neither on the form display widget settings nor on the field settings of the list field you have any apparent way nor explanation how to actively select if the form should be checkboxes or radio buttons.
That is set via the "Allowed number of values" select field on the field settings of the list field. If set to limited with a value of 1, radio buttons are shown, while anything bigger than 1 or unlimited leads to checkboxes. That behavior is not communicated anywhere, it is implied knowledge that the ability to choose between the two is set via the "allowed number of values" setting.
Steps to reproduce
- Add a field of the field type
List (text)to a content type. - Set the number of allowed values to 2
- go to the manage form display page of the content type and check the options for the list fields form display widget
- Try to figure out if it is possible to know just based on the micro copy if the user interface component used will be checkboxes or radio buttons
Proposed resolution
We haven't had the time to ideate and come up with a proper solution yet since the focus was on the actual linked issue. One option might be to simply add a description underneath the "Allowed number of values" setting on the field settings and explain that if set to 1 the output will be radiobuttons while every other setting will result in checkboxes as the output? But that still leaves the problem with the ambiguous and unclear option Check boxes / radio buttons on the form display widget. for someone getting to the form display widget first on an already set up site that is potentially confusing still.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | manage form display.png | 57.52 KB | annmarysruthy |
Issue fork drupal-3472822
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
annmarysruthy commentedA helptext "This widget uses radio buttons if the "Allowed number of values" is set to 1. If the number of allowed values is more than 1 or unlimited, checkboxes will be used." will be displayed in manage form display when Checkboxes/Radio buttons is selected as widget.
Comment #5
annmarysruthy commentedComment #7
smustgrave commentedWas going to mark but proposed solution seems to still be up in the air. @annmarysruthy since you worked on it what was your rational behind the other parts.
Comment #8
rkollerThanks for the initial work on the issue! I've applied and tested MR9507. A few observations and thoughts about the current implementation.
The description
This widget uses radio buttons if the "Allowed number of values" is set to 1. If the number of allowed values is more than 1 or unlimited, checkboxes will be used.is currently placed on theManage form displaypage. First, all the descriptions for the other widgets are of informational nature only, outlining the active settings of a widget, while the description for the list field is purely of instructional nature, telling the user how to set the widget to checkboxs or radio buttons.It is also not clear at all where the "Allowed number of values" is set on this page. The widget doesn't have a settings button even. To someone unfamiliar with Drupal this might be a major source of confusion if the description is referring to a setting which is located on a completely different page.
Having that kind of information available in context on the field settings page when a field and content type is set up is sort of important imho. That was the reason why one of the initial suggestions in the steps to reproduce section was to place the description on the
field settingspage instead of themanage form displaypage.On the other hand "just" moving the description over to the
field settingspage wouldn't solve this multipage problem and the ambiguity coming from the option label (Check boxes / radio buttons) on the select field either entirely.If someone has deliberately set the "allowed number of values" on the
field settingspage to1, then i consider it also potentially confusing still having a settings field label ofCheck boxes / radio buttons. At this point the desired widget was already chosen and you have no edit settings button available for that widget. So having a visual reassurance within the interface, in case2was set on the field settings page, so theselect fieldlabel would just displayRadio buttons, while if the value is set to1on thefield settingsthe option would displayCheckboxesinstead.On the other hand for someone who has not set up the content type and its fields it might be potentially confusing not seeing
Checkboxesin caseRadio buttonsis the available option based on the settings made on thefield settingspage. That was one concern, I think @benjifisher voiced, when I've suggest using either checkboxes or radio buttons as the label depending on the settings on thefield settingspage during the ux meeting.On the first look a simple problem, but on closer look a quite tricky one, if you are trying to provide clarity and situational awareness to the user. I wonder if it would make sense to file the issue for a usability review to discuss the problem in a group context. back then we just noticed and raised it while discussing and reviewing #3459246: Add a '#check_all' option for checkboxes element.
Comment #10
rkollerUsability review
We discussed this issue at #3567765: Drupal Usability Meeting 2026-01-23. The recording of the meeting: https://www.youtube.com/watch?v=s2MS9rYDHws. The attendees at the usability meeting were @pallavi singh3013, @rkoller, @simohell, and @the_g_bomb.
While our initial demoing and exploring of the different scenarios in the context of this issue, we've identified a potential follow-up.
Problem is, if you have a
Selection list textfield with only a single value, the cardinality set to two, the field set torequired, and you have chosen on theManage form displaypage thecheck boxes /radio buttonsoption for that field, that single checkbox is auto selected on the node edit form. Same for the cardinality of one, there the single radio button is getting auto selected without any set default value. With two available options on the field settings either with cardinality of one or two no option is getting preselected. That edge case with a single available option might pose a potential problem if options are added at a later point in the process. So it might be even a necessary step to let radio buttons and checkboxes have different behaviors, but that is out of scope for this issue and more suitable for a followup.In regard of the proposed solution in the issue summary we've concluded that it won't be enough to have just a description underneath the cardinality setting on the field settings page, due to the fact that there are separate permissions with
Administer fieldsandAdminister form display. So it is possible that a user can have access to only theManage form displaypage and in consequence the information in the description would be inaccessible to them. We've also decided against the idea to add a sentence in regard of the implications of the cardinality setting within the help text on theManage form displaypage - the help text is not in close proximity to the widget row, plus within the help text the information can easily be missed if not read closely until the end.We've had a clear consensus that the first touch point for the user can either be on the field settings page or on the
Manage form displaypage, therefore each touch point needs to provide an explanation or some pointer/cue. We've agreed on the following proposed changes:Allowed number of valuesnumbers field, explaining the implication of the chosen number - with a value of one leads to radio buttons on the node edit forms while anything >= 2 leads to checkboxes on node edit form. Unfortunately we haven't had time for word smithing during the meeting.Manage form displaypage we have the problem that adding a description and or a link wouldn't work on field widget rows - there you usually have only the option to display the chosen settings in case there are any. So we came up with two options to stay sort of consistent. It has to be noted that we haven't had a strong preference towards one of following two approach, we wanted to put them up for discussion:Check boxes/radio buttons(current state) and add anEdit field settingsbutton plus display the current active type (either checkbox or radio button) as well as the active cardinality for the field. When clicking the edit button display a disabled numbers field displaying the active cardinality for the field plus a description pointing to the field settings page as the place to change the ui component from one type to the otherCheck boxesandRadio buttons. There should also be anEdit field settingsbutton plus the current active cardinality setting for the field should be displayed. Also displaying the active type (either checkbox or radio button) should be unnecessary here after the active type is equal to chosen option in the select list.Edit field settingsbutton also display a disabled number field displaying the active cardinality for the field plus a description pointing to the field settings page as the place to change the ui component from to the other type.