<p>So looks like I was just missing the extra <code>[]</code> in the name.</p>

<pre><code>fields[borough][]
</code></pre>

<p>Since categories are arrays the name also needed to be an array!</p>

CC BY-SA 3.0
2014-10-02T03:33:41.063Z
2016-05-14T03:45:40.613Z
2016-05-14T03:45:40.613Z
Keith Mancuso
<p>Im trying to setup a front end user form with a category as a select box.  The box looks right but when i submit the form i get a new entry and other fields are filled out but the catgory fields are blank?</p>

<p>This is for a fieldgroup named borough and the field on the section is also called bourough</p>

<pre><code>&lt;form method="post" action="" accept-charset="UTF-8"&gt;
  &lt;input type="hidden" name="action" value="entries/saveEntry"&gt;
  &lt;input type="hidden" name="redirect" value="account/jobs?added={id}"&gt;
  &lt;input type="hidden" name="sectionId" value="9"&gt;
  &lt;input type="hidden" name="enabled" value="0"&gt;

&lt;!-- other form fields --&gt;

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

  &lt;select name="fields[borough]" class="form-control"&gt;
       {% for category in boroughs %}
           &lt;option value="{{category.id}}"&gt;
             {{category}}
           &lt;/option&gt;
       {% endfor %}
  &lt;/select&gt;
&lt;/form&gt;
</code></pre>

CC BY-SA 3.0
2014-09-08T20:42:56.427Z
Probably the same problem as: [Assign Category via Guest Entry Form](http://craftcms.stackexchange.com/questions/1787/assign-category-via-guest-entry-form)
Victor
CC BY-SA 3.0
2014-09-08T21:09:43.867Z
ahh yes... missing the extra [] that did it!  thanks
Keith Mancuso
CC BY-SA 3.0
2014-09-28T22:33:55.397Z
Can you add that as the official answer, @KeithMancuso?
Brad Bell
<categories><form>
Category as select dropdown box
# Category as select dropdown box

(Asked by: username_0 on 2014-09-08)

Im trying to setup a front end user form with a category as a select box.  The box looks right but when i submit the form i get a new entry and other fields are filled out but the catgory fields are blank?
This is for a fieldgroup named borough and the field on the section is also called bourough

  
  
  
  



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

  
       {% for category in boroughs %}
           
             {{category}}
           
       {% endfor %}

**Tags:** categories, form
> **Comments:**
> **username_1**: Probably the same problem as: [Assign Category via Guest Entry Form](http://craftcms.stackexchange.com/questions/1787/assign-category-via-guest-entry-form)  
> **username_0**: ahh yes... missing the extra [] that did it!  thanks  
> **username_2**: Can you add that as the official answer, @KeithMancuso?  

---

## 1 answers

### Answer by username_0 on 2014-10-02. Score: 5

So looks like I was just missing the extra [] in the name.
fields[borough][]

Since categories are arrays the name also needed to be an array!


---

