<p>I just wanted to let you know that I figured this out. I had the section handle in craft.categories.group instead of the category handle. I had just gone through everything again to make sure things were matching up and that's when I found it. Some of my category / section / field names were too similar to each other so too easy to swap out. I just made some tweaks to that to prevent this in the future. Thank you for all of the help and suggestions. So glad that's out of the way and figured out. :)</p>

<p>Thanks!</p>

CC BY-SA 3.0
2014-07-14T10:39:43.477Z
Glad you got it sorted :)
Victor
CC BY-SA 3.0
2014-07-14T02:42:28.737Z
2014-07-14T02:42:28.737Z
Angela
<p>I just tried your code and it worked.</p>

<p>Is your entry getting saved at all? If not I assume there might be another error. Add this to your code to output all form errors:</p>

<pre class="lang-twig prettyprint-override"><code>{% if entry is defined %}
    {{ dump(entry.getErrors()) }}
{% endif %}
</code></pre>

<p>Although it didn't made a difference in my test, you should remove the space to be sure:</p>

<pre class="lang-twig prettyprint-override"><code>value="{{ category.id }}"
</code></pre>

CC BY-SA 3.0
2014-07-12T19:19:35.790Z
Using the dump didn't return any errors. The entry is being saved in the CP and normal text fields such as `<label for="websiteUrl">Website URL</label>
    <input id="websiteUrl" name="fields[websiteUrl]"></input>` are populated, but nothing from the checkbox categories field type gets saved to the entry in the CP. I also want to mention that I am using the Guest Entries plugin for the front-end form if that makes a difference.
Angela
CC BY-SA 3.0
2014-07-13T12:14:41.810Z
Could you deactivate the GuestEntry-plugin, log in as admin, and check again?
Victor
CC BY-SA 3.0
2014-07-14T01:41:48.133Z
Unfortunately that didn't work either. It just seems to be an issue with that Categories Field Type - anything I select is never published to the entry in the CP. Other fields come through just fine. I also checked the permissions and the user has the proper permissions. I also changed the plugin to my admin as author  - http://cl.ly/image/1F2Q2i1E0U15 - and it still does the same thing. I noticed that there is no "Posted Date" with these entries either. Not sure if that is related, but seems strange that the posted date isn't coming through either. Thanks for the help!
Angela
CC BY-SA 3.0
2014-07-12T12:36:20.347Z
2014-07-12T14:32:43.647Z
2014-07-12T14:32:43.647Z
Victor
<p>I have read a few docs about front-end forms such as the <a href="http://buildwithcraft.com/docs/checkboxes-fields" rel="nofollow">Checkbox field docs</a>.</p>

<p>Although that doc doesn't seem to give an example of what I need.</p>

<p>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:</p>

<pre class="lang-twig prettyprint-override"><code>&lt;label for="designTags"&gt;Design Tags&lt;/label&gt;

{% set categories = craft.categories.group('designs') %}

{% for category in categories %}
    &lt;input type="checkbox" id="designTags" name="fields[designsTags][]" value=" {{ category.id }}"&gt; {{ category.title }} &lt;/input&gt; &lt;br /&gt;
{% endfor %}
</code></pre>

<p>I also tried changing <code>category.title</code> to <code>category.id</code>, but no luck with that either. </p>

<p>And before that, I tried something similar to the code at <a href="http://buildwithcraft.com/docs/checkboxes-fields" rel="nofollow">the bottom of this page</a> (using the <code>option.value</code>) and it still wouldn't work.</p>

<p>Any help you can give is greatly appreciated! :)</p>

<categories><form><fieldtypes>
Submitting checkbox data from a front-end form for a 'Categories' Field Type
# Submitting checkbox data from a front-end form for a 'Categories' Field Type

(Asked by: username_0 on 2014-07-12)

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:
Design Tags

{% set categories = craft.categories.group('designs') %}

{% for category in categories %}
     {{ category.title }}  
{% 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! :)

**Tags:** categories, form, fieldtypes

---

## 2 answers

### Answer by username_0 on 2014-07-14. Score: 1 | Accepted answer

I just wanted to let you know that I figured this out. I had the section handle in craft.categories.group instead of the category handle. I had just gone through everything again to make sure things were matching up and that's when I found it. Some of my category / section / field names were too similar to each other so too easy to swap out. I just made some tweaks to that to prevent this in the future. Thank you for all of the help and suggestions. So glad that's out of the way and figured out. :)

Thanks!

> **Comments:**
> **username_1**: Glad you got it sorted :)  

---

### Answer by username_1 on 2014-07-12. Score: 1

I just tried your code and it worked.
Is your entry getting saved at all? If not I assume there might be another error. Add this to your code to output all form errors:
{% if entry is defined %}
    {{ dump(entry.getErrors()) }}
{% endif %}

Although it didn't made a difference in my test, you should remove the space to be sure:
value="{{ category.id }}"

> **Comments:**
> **username_0**: Using the dump didn't return any errors. The entry is being saved in the CP and normal text fields such as `<label for="websiteUrl">Website URL</label>     <input id="websiteUrl" name="fields[websiteUrl]"></input>` are populated, but nothing from the checkbox categories field type gets saved to the entry in the CP. I also want to mention that I am using the Guest Entries plugin for the front-end form if that makes a difference.  
> **username_1**: Could you deactivate the GuestEntry-plugin, log in as admin, and check again?  
> **username_0**: Unfortunately that didn't work either. It just seems to be an issue with that Categories Field Type - anything I select is never published to the entry in the CP. Other fields come through just fine. I also checked the permissions and the user has the proper permissions. I also changed the plugin to my admin as author  - http://cl.ly/image/1F2Q2i1E0U15 - and it still does the same thing. I noticed that there is no "Posted Date" with these entries either. Not sure if that is related, but seems strange that the posted date isn't coming through either. Thanks for the help!  

---

