How to implement radiobuttons field on frontend registration form? I want to add a question to a frontend registration form.
The radiobuttons are just 'Yes' or 'No'.

I've created a radiobutton field and added that to users > fields.

If I add this option to the form, new registrations are not submitted.
The page reloads and doesn't redirect to the confirmation page.

Any idea what's wrong with my form?

&lt;legend&gt;Are you a Beekeeper?&lt;/legend&gt;
&lt;input type="hidden" name="fields[areYouBeekeeper]" value=""&gt;
{% for option in entry.areYouBeekeeper.options %}
    &lt;input id="isBeekeeper{{ option.label }}" type="radio" name="fields[areYouBeekeeper][]" 
    {%- if account is defined %}value="{{ option.label }}"{% endif -%}&gt;
    &lt;label for="isBeekeeper{{ option.label }}"&gt;{{ option.value }}&lt;/label&gt;
{% endfor %}


Here's the complete form template.

&lt;form method="post" accept-charset="UTF-8"&gt;
    {{ getCsrfInput() }}
    &lt;input type="hidden" name="action" value="users/saveUser"&gt;
    &lt;input type="hidden" name="redirect" value="{{ siteUrl }}registration/confirmation"&gt;

    {% macro errorList(errors) %}
        {% if errors %}
            &lt;ul class="errors" style="list-style: none;"&gt;
                {% for error in errors %}
                    &lt;li style="color:red;"&gt;{{ error }}&lt;/li&gt;
                {% endfor %}
            &lt;/ul&gt;
        {% endif %}
    {% endmacro %}

    {% from _self import errorList %}

    &lt;label&gt;Username
        &lt;input id="username" type="text" placeholder="gebruikersnaam" name="username"
        {%- if account is defined %} value="{{ account.username }}"{% endif -%}&gt;
    &lt;/label&gt;
    {% if account is defined %}{{ errorList(account.getErrors('username')) }}{% endif %}

    &lt;label&gt;Email
        &lt;input id="email" type="text" placeholder="somebody@example.com" name="email"
        {%- if account is defined %} value="{{ account.email }}"{% endif %}&gt;
    &lt;/label&gt;
    {% if account is defined %}{{ errorList(account.getErrors('email')) }}{% endif %}

    &lt;label&gt;Password
        &lt;input id="password" type="password" placeholder="password" name="password"&gt;
    &lt;/label&gt;
    {% if account is defined %}{{ errorList(account.getErrors('password')) }}{% endif %}

    &lt;label&gt;First name
        &lt;input id="firstName" type="text" placeholder="First name" name="firstName"
        {%- if account is defined %} value="{{ account.firstName }}"{% endif -%}&gt;
    &lt;/label&gt;
    {% if account is defined %}{{ errorList(account.getErrors('firstName')) }}{% endif %}

    &lt;label&gt;Last name
        &lt;input id="lastName" type="text" placeholder="Last name" name="lastName"
        {%- if account is defined %} value="{{ account.lastName }}"{% endif -%}&gt;
    &lt;/label&gt;
    {% if account is defined %}{{ errorList(account.getErrors('lastName')) }}{% endif %}

    &lt;legend&gt;Are you a Beekeeper?&lt;/legend&gt;
    &lt;input type="hidden" name="fields[areYouBeekeeper]" value=""&gt;
    {% for option in entry.areYouBeekeeper.options %}
        &lt;input id="isBeekeeper{{ option.label }}" type="radio" name="fields[areYouBeekeeper][]" 
        {%- if account is defined %}value="{{ option.label }}"{% endif -%}&gt;
        &lt;label for="isBeekeeper{{ option.label }}"&gt;{{ option.value }}&lt;/label&gt;
    {% endfor %}

    &lt;input type="submit" class="button expanded" value="Registreer"&gt;

&lt;/form&gt;


I think the problem is with the for loop. I'm trying to output the radio options with a for loop on an entry, but it's actually not an entry. No idea why I do get the options anyway.
I've managed to get this working with the following code:

&lt;input type="hidden" name="fields[areYouBeekeeper]" value=""&gt;

&lt;label&gt;&lt;input type="radio" value="yes" name="fields[areYouBeekeeper]" {%- if account is defined %}value="{{ account.areYouBeekeeper }}"{% endif -%}&gt;Yes&lt;/label&gt;
&lt;label&gt;&lt;input type="radio" value="no" name="fields[areYouBeekeeper]" {%- if account is defined %}value="{{ account.areYouBeekeeper }}"{% endif -%}&gt;No&lt;/label&gt;
Because radio inputs are a "single value field", meaning that when the form submits, only one value actually goes through, you don't need the extra [] array brackets at the end of each fields[] array.  In fact, you don't even need the hidden field above it.  That setup would work for checkboxes, where any number of values could be submitted. A great reference for how to format HTML form fields correctly to submit to Craft can be found on this StraightUpCraft article.

Your code should look like this:

&lt;label&gt;
    &lt;input type="radio" value="yes" name="fields[areYouBeekeeper]" {%- if account is defined %}value="{{ account.areYouBeekeeper }}"{% endif -%}&gt;Yes
&lt;/label&gt;
&lt;label&gt;
    &lt;input type="radio" value="no" name="fields[areYouBeekeeper]" {%- if account is defined %}value="{{ account.areYouBeekeeper }}"{% endif -%}&gt;No
&lt;/label&gt;


And the input values yes and no need to be exactly the same (lowercase in this case) as they are in the Values column of the respective custom radio field created in the CMS.