<p>You can access the field using <code>currentUser.fieldHandle</code>; and the 'labels' and 'values' of the field by looping through the <code>options</code> attribute. You can also set the selected state by checking each option for the <code>option.selected</code> property.</p>

<pre><code>&lt;select id="radioButtons" name="fields[myRadioButton]"&gt;
    {% for option in currentUser.myRadioButton.options %}
        &lt;option value="{{ option.value }}" {% if option.selected %}checked{% endif %}&gt;{{ option.label }}&lt;/option&gt;
    {% endfor %}
&lt;/select&gt;
</code></pre>

CC BY-SA 3.0
2015-04-23T17:57:12.167Z
Exactly what I wanted. That answers other questions I had as well. Thanks Douglas
user2056505
CC BY-SA 3.0
2015-04-23T06:07:27.873Z
2015-04-23T06:07:27.873Z
Douglas McDonald
<p>In the <a href="http://buildwithcraft.com/docs/templating/user-profile-form" rel="nofollow">official documentation</a> it explains how to let users customize user fields in the frontend, such as:</p>

<pre><code>&lt;label for="bio"&gt;Bio&lt;/label&gt;
&lt;textarea id="bio" name="fields[bio]"&gt;{{ currentUser.bio }}&lt;/textarea&gt;
</code></pre>

<p>However I set some user profile fields that are Radio Buttons and can't find anywhere on how to output the field options in a form. I want to do something like:</p>

<pre><code>&lt;select id="radioButtons" name="fields[radioButtons]"&gt;
  {% for option in fields.profile.myRadioButtons %}
    &lt;option value="option"&gt;{{ option | title }}&lt;/option&gt;
  {% endfor %}
&lt;/select&gt;
</code></pre>

<p>But obviously 'fields' isn't a twig variable. Is there a way to do something similar to the above?</p>

<templating><form><field>
Frontend Profile - Listing out Radio Buttons
# Frontend Profile - Listing out Radio Buttons

(Asked by: username_0 on 2015-04-23)

In the official documentation it explains how to let users customize user fields in the frontend, such as:
Bio
{{ currentUser.bio }}

However I set some user profile fields that are Radio Buttons and can't find anywhere on how to output the field options in a form. I want to do something like:

  {% for option in fields.profile.myRadioButtons %}
    {{ option | title }}
  {% endfor %}


But obviously 'fields' isn't a twig variable. Is there a way to do something similar to the above?

**Tags:** templating, form, field


---

## 1 answers

### Answer by username_1 on 2015-04-23. Score: 2 | Accepted answer

You can access the field using currentUser.fieldHandle; and the 'labels' and 'values' of the field by looping through the options attribute. You can also set the selected state by checking each option for the option.selected property.

    {% for option in currentUser.myRadioButton.options %}
        {{ option.label }}
    {% endfor %}

> **Comments:**
> **username_0**: Exactly what I wanted. That answers other questions I had as well. Thanks Douglas  

---

