Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-13T09:14:50.393Z
Answers.Text: Brad, thanks for your help. This worked, and encouraging to know I wasn't far off when I had!
Answers.UserDisplayName: Steve Davies
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-12T18:55:19.907Z
Answers.LastActivityDate: 2017-09-12T18:55:19.907Z
Answers.UserDisplayName: Brad Bell
Body: <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>
  
Tags: <templating>
Title: How to use Twig to pull drop down menu items for a front end form
ThreadText: # 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.
  
  ```
  <ul>
      {% for checkboxOption in currentUser.fieldHandle.options %}
          {% set checked = false %}
  
          {% if checkboxOption.selected %}
              {% set checked = true %}
          {% endif %}
  
          <li>
              <input type="radio" value="{{ checkboxOption.value }}" name="fields[fieldHandle]" {% if checked %} checked="checked" {% endif %}><span>{{ checkboxOption.label }}</span>
          </li>
      {% endfor %}
  </ul>
  
  ```
  
  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:
  
  ```
  <select name="fields[fieldHandle]">
  
      {% for dropdownOption in currentUser.fieldHandle.options %}
          <option value="{{ dropdownOption.value }}"{% if option.selected %} selected{% endif %}>{{ dropdownOption.label }}</option>
      {% endfor %}
  
  </select>
  
  ```
  
  > **Comments:**
  > **username_0**: username_1, thanks for your help. This worked, and encouraging to know I wasn't far off when I had!  
  
  ---
  
  