grav-plugin-form icon indicating copy to clipboard operation
grav-plugin-form copied to clipboard

checkboxes are not rendered in data.html.twig email body when used in fieldsets

Open sebastianbaumann opened this issue 6 years ago • 3 comments

Like I mentioned in another issue, something seems broken with the checkbox.html.twig template. I define checkbox fields like this in my form.md

beratung:
  type: checkbox
  outerclasses: px1 w12 mb1
  label: "Beratung vor Ort"

But when sending the email, they will not appear in the email body.

sebastianbaumann avatar Jun 06 '18 14:06 sebastianbaumann

Just figured out, there seems to be a problem when using checkboxes inside a fieldset. Outside fieldsets, checkboxes are rendered properly.

form:
    name: multistep-form
    classes: multistep
    fields:
          ### THIS WORKS
        - name: test2133
          type: checkbox
          label: "Test"
       - name: step1
          id: step1
          type: fieldset
          legend: ''
          fields:
           ### THIS DOESN'T
            test2:
                type: checkbox
                label: "Test"

sebastianbaumann avatar Jun 06 '18 14:06 sebastianbaumann

Same for using forms with columns btw...

sebastianbaumann avatar Aug 10 '18 09:08 sebastianbaumann

Forms with columns arent supported for frontend, only for the admin panel. Maybe that is the issue? I am not sure about fieldsets.

Which template are your using for sending the email? I guess it is this one: https://github.com/getgrav/grav-plugin-form/blob/develop/templates/forms/default/data.html.twig

This does not support fieldsets at all. So its not an issue of the checkboxes, it is an issue of the fieldset. Is the fieldset really required?

NicoHood avatar Jan 09 '21 17:01 NicoHood