<p>You'd do something very similar:</p>

<pre><code>&lt;select name="fields[fieldHandle]"&gt;

    {% for dropdownOption in currentUser.fieldHandle.options %}
        &lt;option value="{{ dropdownOption.value }}"{% if option.selected %} selected{% endif %}&gt;{{ dropdownOption.label }}&lt;/option&gt;
    {% endfor %}

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

CC BY-SA 3.0
2017-09-13T09:14:50.393Z
Brad, thanks for your help. This worked, and encouraging to know I wasn't far off when I had!
Steve Davies
CC BY-SA 3.0
2017-09-12T18:55:19.907Z
2017-09-12T18:55:19.907Z
Brad Bell
<p>I have this code that will pull the values of a checkbox or radio from the fields in Craft CMS, do be used and selected by a user on a front end form.</p>

<pre><code>&lt;ul&gt;
    {% for checkboxOption in currentUser.fieldHandle.options %}
        {% set checked = false %}

        {% if checkboxOption.selected %}
            {% set checked = true %}
        {% endif %}

        &lt;li&gt;
            &lt;input type="radio" value="{{ checkboxOption.value }}" name="fields[fieldHandle]" {% if checked %} checked="checked" {% endif %}&gt;&lt;span&gt;{{ checkboxOption.label }}&lt;/span&gt;
        &lt;/li&gt;
    {% endfor %}
&lt;/ul&gt;
</code></pre>

<p>How do I do the same for a dropdown list?</p>

<templating>
How to use Twig to pull drop down menu items for a front end form
# How to use Twig to pull drop down menu items for a front end form

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

I have this code that will pull the values of a checkbox or radio from the fields in Craft CMS, do be used and selected by a user on a front end form.

    {% for checkboxOption in currentUser.fieldHandle.options %}
        {% set checked = false %}

        {% if checkboxOption.selected %}
            {% set checked = true %}
        {% endif %}

        
            {{ checkboxOption.label }}
        
    {% endfor %}


How do I do the same for a dropdown list?

**Tags:** templating


---

## 1 answers

### Answer by username_1 on 2017-09-12. Score: 0 | Accepted answer

You'd do something very similar:


    {% for dropdownOption in currentUser.fieldHandle.options %}
        {{ dropdownOption.label }}
    {% endfor %}

> **Comments:**
> **username_0**: Brad, thanks for your help. This worked, and encouraging to know I wasn't far off when I had!  

---

