getgrav / getgrav/grav-plugin-form
Nested fieldsets are not working nice as expected / Group of radio buttons
- Dominant language
- PHP
- Stars
- 64
- Forks
- 80
- Avg merge
- 10h 13m
- Merged PRs (30d)
- 9
Description
Recently I had a website project with a complex form using fieldsets as accordion wrappers for the top level fieldsets and normal fieldsets within in modular page (4 top level fieldsets (normally 5 including the last item, 10 nested fieldsets).
1) The biggest issue have been nested fieldsets. I was trying to to put different markups within the same custom fieldset field template.
The top-level fieldset got a markup for being used as an accordion wrapper except the last item (not used as an accordion).
The last fieldset item in the top level had validation errors therefore I had to remove this fieldset for a dirty spacer solution to get it working (validate and sending e-mail). You can look at the attached custom fieldset template. [fieldset.html.twig.zip](https://github.com/getgrav/grav-plugin-form/files/1741464/fieldset.html.twig.zip)
2) Group of radio buttons
I have seen the there is currently no possibility to use a fieldset for a group of radios to give a semantically correct structure:
e.g visual structure:
Gender *
o male o female
this should ideally get the following simplified markup (for better understanding):
```
Gender *
Male
Female
```
instead of this markup it is only possible to get the following structure via the following yaml field definition, which lead to an orphaned label (form-label) to get the visual structure shown above:
```
-
name: gender1
label: Gender
type: radio
outerclasses: row
innerclasses: col-md-6
options:
man: Male
woman: Female
validate:
required: true
```
turns into:
```
Gender *
Male
Female
```
Nonetheless I got the form working, but for accessibility it's an error. Therefore I am asking if there are any plans for any enhancements concerning this usecase. Because this would be an another enormous win for grav as a system to achieve perfect markup with ease and speed! :)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.