Add Checked Attribute to Custom User Fields on Frontend User Form I have a multi-select for users to sign up for newsletters.
When they edit their profile they need to be able to see which newsletters they are already signed up for. I have the code to output the entire options list or just the ones that they have selected but I haven't figured a way to add the selected attribute to the ones the user has selected.

{% set newsletters = craft.fields.getFieldByHandle('newsletters') %}
&lt;select multiple&gt;
    {% for opt in newsletters.settings.options %}
        &lt;option value="{{ opt.value }}" &gt;{{ opt.label }}&lt;/option&gt;
    {% endfor %}
&lt;/select&gt;


The "for opt in newsletters.settings.options" can be changed to "for opt in newsletters.settings" to show just the ones the user has already selected.
Solved!

{% for letter in currentUser.newsletters.options %}
    &lt;input type="checkbox" value="{{ letter.value }}" name="{{ letter.value }}" id="{{ letter.value }}"
        {% if letter.selected == true %}checked="checked" {% endif %}/&gt;
    &lt;label for ="{{ letter.value }}"&gt;{{ letter.label }}&lt;/label&gt;
{% endfor %}