No option to change the label-attribute from checkboxes and radios-fields #1709
Replies: 2 comments 1 reply
-
Hi @Megafry, Thank you for your feedback. There is the option to apply stuff to the As for the better accessible approaches, it's on our list to move in this direction or at least build one sample template that is fully accessible out of the box. The trouble with making that change now is that anyone using these sample templates may have CSS that expects the current approach and changing it will break it for them. In the meantime, you can approach both of the issues you mention with an approach that some of our sample formatting templates take:
|
Beta Was this translation helpful? Give feedback.
-
Thank you for your feedback. I understand that this change is breaking. Formie has elegantly solved this problem by having a config array. Can you extend the Formie config array: 'radioButtons' => [
'fieldContainer' => [
'tag' => 'fieldset',
],
'fieldLabel' => [
'tag' => 'legend',
'attributes' => [
'class' => 'label--legend',
],
],
'fieldInput' => [
'attributes' => [
'class' => [
'input',
'input--radio',
]
],
],
'fieldOptionLabel' => [
'attributes' => [
'class' => [
'label',
'label--option'
]
],
],
] |
Beta Was this translation helpful? Give feedback.
-
There is no way to add a class to the label wrapping the checkbox, can this be added?
code
PS: the generated HTML is not w3c valid:
Error: The value of the for attribute of the label element must be the ID of a non-hidden form control.
Better approach:
Environment
Beta Was this translation helpful? Give feedback.
All reactions