I currently have front-end code working for a user to create an entry, add a title (text input) and also relate entries via the entries field type and checkboxes. All on a front-end application.
Creating the entry is fine, but I'm having an issue with the editing of the entry.
I'm unable/unsure how to "check" what the previously selected relate entries where. Code for showing entry items...
{% set entries = craft.entries.section('exercises') %}
{% for entry in entries %}
<li>
<input type="checkbox" name="fields[planItems][]"
id="fields[planItems]" value="{{ entry.id }}">{{ entry.title }}
</li>
Other fields are fine such as the title field, all you have to add is {%- if entry is defined %} value="{{ entry.title }}"{% endif -%}>
.
Any ideas on how to get that value so I can add checked
to the previously selected entries?
Thanks!