I have a form with a checkbox field. I want the options of the checkbox to be pulled from an entry field.
My custom field template is below but it wont pass validation. I guess this is because Sprout looks for the option values to validate but as they are populated from an entry it wont pass??
At the moment the example below is successfully displaying the entry data as options in the checkbox, it just wont allow me to submit the form.
{% if handle == "checkboxes1" %}
<div
{%- if id %} id="{{ id }}"{% endif %}
{%- if class %} class="{{ class }}"{% endif %}>
{% if name is defined and (name|length < 3 or name|slice(-2) != '[]') %}
<input type="hidden" aria-hidden="true" name="{{ name }}" value="">
{% endif %}
{% for date in entry.eventOccurrences %}
<label for="checkboxes1-{{ loop.index }}">
<input type="checkbox"
data-value="{{ date.date }}"
{%- if name %} name="checkboxes1"{% endif %}
{%- if id %} id="checkboxes1-{{ loop.index }}"{% endif %}
{%- if value %} value="value-{{ loop.index }}"{% endif %}
>
{{ date.date }}||
</label>
{% endfor %}
</div>
{% endif %}