Closed dave-smyth closed 3 years ago
Nice find.
@websmyth what does your template code look like for that mailing_list
field?
My template code looks like this and it works fine:
<div class="form-group">
<label>Permission</label>
<input type="checkbox" name="permission" value="true" class="form-control"/>
</div>
I’m looping over the fields:
<div class="formFields">
{{ fields }}
<div class="field {{ type }}Field">
{{ if type !== "checkboxes" }}
<label for="{{ handle }}" class="fieldLabel">{{ display }}</label>
{{ endif }}
<div>{{ field }}</div>
</div>
{{ /fields }}
</div>
That produces:
<div class="field checkboxesField">
<div>
<label><input type="checkbox" name="mailing_list[]" value="true" >Subscribe me to the mailing list</label>
</div>
</div>
ok that's what I thought, easy fix.
Not sure if this is an add-on issue, apologies if not...
I’m using a checkbox field as a
consent
and submitting the form with thischecked
returns:Return value of Silentz\Mailchimp\Subscriber::hasConsent() must be of the type bool, array returned
The relevant part of the
blueprint
:Can anything be done to recognise this field/array? I’d guess a
radio
would work, but would prefer for users to be able to check/uncheck.Perhaps I need to set this up a different way?