I have read a few docs about front-end forms such as the Checkbox field docs.
Although that doc doesn't seem to give an example of what I need.
I have a 'categories' field type. I am creating a front-end form that will need to submit what is checked to the entry. I have tried a few different ways and can't get it to work. This is the last code I tried:
<label for="designTags">Design Tags</label>
{% set categories = craft.categories.group('designs') %}
{% for category in categories %}
<input type="checkbox" id="designTags" name="fields[designsTags][]" value=" {{ category.id }}"> {{ category.title }} </input> <br />
{% endfor %}
I also tried changing category.title
to category.id
, but no luck with that either.
And before that, I tried something similar to the code at the bottom of this page (using the option.value
) and it still wouldn't work.
Any help you can give is greatly appreciated! :)