<p>On your dropdown field's <code>name</code>, you need a <code>[]</code> on the end for it to submit properly:</p>

<pre><code>name="fields[demographic][]"
</code></pre>

<p>As mentioned in <a href="https://craftcms.stackexchange.com/questions/1787/assign-category-via-guest-entry-form">this answer</a>, the dropdown field is basically an array of options, so you need that empty array on the end for them to be stored in.</p>

CC BY-SA 4.0
2018-12-10T15:58:17.410Z
2018-12-10T15:58:17.410Z
Jalen Davenport
<p>My front-end new entry form works, but when I add the complexity of a dropdown to the mix - it error's and doesn't save the entry. (I found this out with trial and error, removing fields until I found the culprit - the dropdowns)</p>

<p>I'm unsure what errors it's returning, but I'm sure something may be off with the code.</p>

<pre><code>  {% macro errorList(errors) %}
            {% if errors %}
                &lt;ul class="errors"&gt;
                    {% for error in errors %}
                        &lt;li&gt;{{ error }}&lt;/li&gt;
                    {% endfor %}
                &lt;/ul&gt;
            {% endif %}
        {% endmacro %}

        {% from _self import errorList %}

        &lt;form method="post" accept-charset="UTF-8" enctype="multipart/form-data"&gt;
            {{ csrfInput() }}
            &lt;input type="hidden" name="action" value="entries/save-entry"&gt;
            {{ redirectInput('/listings/') }}
            &lt;input type="hidden" name="sectionId" value="1"&gt;
            &lt;input type="hidden" name="enabled" value="1"&gt;

            &lt;div class="form-group"&gt;
              &lt;label&gt;Demographic&lt;/label&gt;
              &lt;select class="form-control" id="listingType" name="fields[demographic]"&gt;
                {% set demographicField = craft.fields.getFieldbyHandle('demographic') %}
                {% for option in demographicField.settings.options %}
                  &lt;option&gt;{{ option.label }}&lt;/option&gt;
                {% endfor %}
              &lt;/select&gt;
            &lt;/div&gt;

            &lt;button class="btn btn-primary btn-md semi-bold" type="submit"&gt;Create Listing&lt;/button&gt;

        &lt;/form&gt;
</code></pre>

<templating><form>
Front End Entry Form Select Dropdown Error
# Front End Entry Form Select Dropdown Error

(Asked by: username_0 on 2018-12-09)

My front-end new entry form works, but when I add the complexity of a dropdown to the mix - it error's and doesn't save the entry. (I found this out with trial and error, removing fields until I found the culprit - the dropdowns)
I'm unsure what errors it's returning, but I'm sure something may be off with the code.
  {% macro errorList(errors) %}
            {% if errors %}
                
                    {% for error in errors %}
                        {{ error }}
                    {% endfor %}
                
            {% endif %}
        {% endmacro %}

        {% from _self import errorList %}

        
            {{ csrfInput() }}
            
            {{ redirectInput('/listings/') }}
            
            

            
              Demographic
              
                {% set demographicField = craft.fields.getFieldbyHandle('demographic') %}
                {% for option in demographicField.settings.options %}
                  {{ option.label }}
                {% endfor %}
              
            

            Create Listing

**Tags:** templating, form


---

## 1 answers

### Answer by username_1 on 2018-12-10. Score: 3 | Accepted answer

On your dropdown field's name, you need a [] on the end for it to submit properly:
name="fields[demographic][]"

As mentioned in this answer, the dropdown field is basically an array of options, so you need that empty array on the end for them to be stored in.


---

