Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap single checkbox for boolean fields in fieldset #4

Open
thomasmassmann opened this issue Dec 18, 2021 · 0 comments
Open

Wrap single checkbox for boolean fields in fieldset #4

thomasmassmann opened this issue Dec 18, 2021 · 0 comments
Assignees
Labels
A11Y Accessibility issues enhancement New feature or request

Comments

@thomasmassmann
Copy link
Member

For better accessibility checkbox fields should be wrapped in a fieldset with a legend. The current implementation (https://github.com/plone/plone.app.z3cform/blob/master/plone/app/z3cform/templates/singlecheckboxbool_input.pt) wraps the checkbox in a div

Current implementation for the plone.versioning behavior (Plone 6, german):

Screenshot 2021-12-18 at 18 28 15

The label for the field is the checkbox label (so the answer). This can be confusing for people, as the logical form pattern (label -> field) is broken.

An example is shown in Adam Silver’s book “Form Design Patterns”:

Single Checkbox for Boolean Fields

He uses a “question” -> “answer” pattern. This requires an additional setting for the widget in Plone, since the field only has one title and description. The title should be used for the label, and an additional checkbox title can be defined at the widget. If this one is not available, the title would be used a second time. An automatically created text for the answer as fallback if the checkbox title is not available is not recommended, as this can lead to unexpected wordings and confusing labels.

Example for the plone.versioning behavior (Plone 6, german) with a custom checkbox title:

Screenshot 2021-12-18 at 18 22 57

@thomasmassmann thomasmassmann added enhancement New feature or request A11Y Accessibility issues labels Dec 18, 2021
@thomasmassmann thomasmassmann self-assigned this Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A11Y Accessibility issues enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant