User registration form with checkbox field Hi I have user registration form with multiple custom fields. They all work fine except for the field I have as a checkbox. It returns an error of 'my-field' is invalid. Any ideas anyone? code below (field in question is towards the bottom)...

&lt;form method="post" accept-charset="UTF-8" class="login-form"&gt;
            {{ getCsrfInput() }}
            &lt;input type="hidden" name="action" value="users/saveUser"&gt;
            &lt;input type="hidden" name="redirect" value="{{ url('collection/') }}"&gt;

            &lt;h3&gt;Register&lt;/h3&gt;


            &lt;p&gt;To browse our collection please register your information below.&lt;/p&gt;

            &lt;p&gt;Already registered? &lt;a href="#login-modal" class="toggle-modal-trigger"&gt;Login&lt;/a&gt;.&lt;/p&gt;

            {{ entry.contentBeforeForm }}

            {% macro errorList(errors) %}
                {% if errors %}
                    &lt;ul class="errors"&gt;
                        {% for error in errors %}
                            &lt;li&gt;{{ error }}&lt;/li&gt;
                        {% endfor %}
                    &lt;/ul&gt;
                {% endif %}
            {% endmacro %}

            {% from _self import errorList %}



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

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

            &lt;h4&gt;&lt;label for="company"&gt;Company&lt;/label&gt;&lt;/h4&gt;
            &lt;input id="company" type="text" name="fields[company]" {%- if account is defined %} value="{{ account.company }}"{% endif %} placeholder="Company"&gt;  
            {{ account is defined and account ? errorList(account.getErrors('company')) }} 

            &lt;h4&gt;&lt;label for="phone"&gt;Phone&lt;/label&gt;&lt;/h4&gt;
            &lt;input id="phone" type="text" name="fields[phone]" {%- if account is defined %} value="{{ account.phone }}"{% endif %} placeholder="Phone"&gt;
            {{ account is defined and account ? errorList(account.getErrors('phone')) }}

            &lt;h4&gt;&lt;label for="username"&gt;Username&lt;/label&gt;&lt;/h4&gt;
            &lt;input id="username" type="text" name="username" {%- if account is defined %} value="{{ account.username }}"{% endif -%} placeholder="Username"&gt;

            {% if account is defined %}
                {{ errorList(account.getErrors('username')) }}
            {% endif %}

            &lt;h4&gt;&lt;label for="email"&gt;Email&lt;/label&gt;&lt;/h4&gt;
            &lt;input id="email" type="text" name="email" {%- if account is defined %} value="{{ account.email }}"{% endif %} placeholder="Email"&gt;

            {% if account is defined %}
                {{ errorList(account.getErrors('email')) }}
            {% endif %}


            &lt;h4&gt;&lt;label for="password"&gt;Password&lt;/label&gt;&lt;/h4&gt;
            &lt;input id="password" type="password" name="password"&gt;

            {% if account is defined %}
                {{ errorList(account.getErrors('password')) }}
            {% endif %}

            {# HERE IS THE FIELD CAUSING THE ERROR #}
            &lt;label&gt;
            &lt;input type="checkbox" id="termsAgreement" name="fields[termsAgreement]" {%- if account is defined %}value="1" checked{% endif %}&gt;
             I agree to terms and conditions above
            &lt;/label&gt;
            {{ account is defined and account ? errorList(account.getErrors('termsAgreement')) }}

            &lt;input type="submit" value="Register"&gt;

        &lt;/form&gt;
Just in case anyone else has this issue i got it working with these modifications.

I think the hidden field was required for the possibility of null values.

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


It also required the extra [] brackets after the field name in the checkbox option (as checkbox fields are an array).

name="fields[myCustomField][]"


Here's my code thats working:
    

            &lt;input type="hidden" name="fields[termsAgreement]" value="no"&gt;
            &lt;input type="checkbox" id="termsAgreement" name="fields[termsAgreement][]" value="yes"&gt;

             I agree to terms and conditions above
            &lt;/label&gt;
            {{ account is defined and account ? errorList(account.getErrors('termsAgreement')) }}