We have a user signup form (see http://thinkdif.co/me/signup) that has some extra required fields. When a craft field us missed out, the error code below works, however when a custom User field is not completed, the page does not save, but no error is presented.

We require errors on custom user signup fields, and also on the 'Update your profile' page that is presented later in the workflow.

Thanks for any help or examples. End goal is to have good required fields throughout the user workflow.


Example error code:

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


Here is a gist of the full page. https://gist.github.com/slipstreamstudio/d8dd801d722c3f275b74

  • Have you set the field as required in the Control Panel? Jul 17, 2014 at 12:50
  • Yes - all set but errors are not returning for custom fields.
    – Dan G
    Jul 18, 2014 at 20:30

1 Answer 1

  1. There was a bug in Craft such that when saving a user, if the username / email / password failed validation first, content validation would never get a chance to run.

    Have just fixed that locally and it will go out in the next release.

  2. The way you have your dropdowns defined (userCountry and occupation), they'll never fail validation because there will always be a value selected and submitted in $_POST.

  3. The first name and last name fields on a user account are somewhat “special” fields. There is currently no way to set them as required. We've got some plans to revamp how user names are handled on “The List”™ for a future update. In the meantime, if you want to make them required fields, you can create actual custom fields for them.

  • Thanks Brad - that will solve it - do you know when I can integrate this fix - I have a client desperate for the custom fields to work as required.
    – Dan G
    Jul 21, 2014 at 7:15
  • 1
    Is there any update Brad on being able to make first name and last name fields required? I was researching how to do that and found this answer. For now I'll just use custom fields as you suggest.
    – Dave Joyce
    Jun 17, 2016 at 16:58
  • Will this be in Craft 3? Apr 14, 2017 at 15:00
  • 1
    Apparently not, I cannot find anywhere in craft 3 that allows you to force the first and last name to be required. Jul 29, 2020 at 19:08
  • 1
    Kind of ridiculous you can't set this fields as required. There are many scenarios where someone would want this data and be sure it's in there for registration Aug 26, 2020 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.