Answers.Body: <p>You need to check the <code>currentUser</code> country if it's the same as the option value -> select the option </p>
  
  <pre class="lang-twig prettyprint-override"><code>&lt;option {{ currentUser.country.value == option.value? 'selected' : '' }} value="{{ option.value }}" &gt;{{ option.label }}&lt;/option&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-10T22:02:16.137Z
Answers.LastActivityDate: 2018-10-10T22:02:16.137Z
Answers.UserDisplayName: Robin Schambach
Body: <p>I have a Countries dropdown menu for signing up that i didn't have before. It used to just be a text field where they can input their own country. It works on the front end sign up form properly, but for the users who don't have the country selected from the new dropdown need to select a country. I have the dropdown on a front end profile form, however when the user "updates" their profile if they don't choose the country it just resets. </p>
  
  <p>For example, I signed in and my country is set to USA and i go to my account to update my password, it resets what's selected on the countries dropdown.</p>
  
  <p>I would like to show the County dropdown for the users who hasn't selected their countries and if the user already selected their country to just show the value they selected.</p>
  
  <p>The code below is the code for the select.</p>
  
  <pre><code>{% set dropdownField = craft.fields.getFieldbyHandle('country') %}
  &lt;label for="country"&gt;Country&lt;/label&gt;
  &lt;select class="form-control" id="country" name="fields[country]"&gt;
      {% for option in dropdownField.settings.options %}
          &lt;option value="{{ option.value }}" &gt;{{ option.label }}&lt;/option&gt;
      {% endfor %}
  &lt;/select&gt;
  </code></pre>
  
Tags: <craft3><users><form><user-profile>
Title: User Account Form Dropdown
ThreadText: # User Account Form Dropdown
  
  (Asked by: username_0 on 2018-10-10)
  
  I have a Countries dropdown menu for signing up that i didn't have before. It used to just be a text field where they can input their own country. It works on the front end sign up form properly, but for the users who don't have the country selected from the new dropdown need to select a country. I have the dropdown on a front end profile form, however when the user "updates" their profile if they don't choose the country it just resets.
  
  For example, I signed in and my country is set to USA and i go to my account to update my password, it resets what's selected on the countries dropdown.
  
  I would like to show the County dropdown for the users who hasn't selected their countries and if the user already selected their country to just show the value they selected.
  
  The code below is the code for the select.
  
  ```
  {% set dropdownField = craft.fields.getFieldbyHandle('country') %}
  <label for="country">Country</label>
  <select class="form-control" id="country" name="fields[country]">
      {% for option in dropdownField.settings.options %}
          <option value="{{ option.value }}" >{{ option.label }}</option>
      {% endfor %}
  </select>
  
  ```
  
  **Tags:** craft3, users, form, user-profile
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-10-10. Score: 2
  
  You need to check the `currentUser` country if it's the same as the option value -> select the option
  
  ```twig
  <option {{ currentUser.country.value == option.value? 'selected' : '' }} value="{{ option.value }}" >{{ option.label }}</option>
  
  ```
  
  
  ---
  
  