To add fields to the User Registration one can directly use the admin/config/people/accounts page. However, I am required to some other fields to the User Registration like food choice which is to be selected from drop-down list of foods, Email and Confirm Email fields (which should check whether both are same and whether the email was used in db), country (If UK/US is selected, text field for state, postal code should appear). Now, I could add the fields to the user registration page, but how can I handle the validations for the fields and how do I show such dropdown list. Am I required to create my module that extends the User Registration form. If so, how do I do this? Thanks.

1 Answer 1


If your only need is to add new required fields to the user registration form, you do not need modify the form through a module; by marking any user entity field as a Required field in the field UI, it will be presented in the registration form as a required field for registration.

If you require custom validation that goes beyond "it must be non-empty" you might need to employ a custom validation handler in a custom module, another helper module (e.g. Field validation), or a custom field module that matches your use case (e.g. Address field module).

  • So, if I were not to use any external module like Field Validation, should I create a separate module for user registration making own forms with validation.
    – Mahadeva
    Commented Oct 18, 2016 at 19:40
  • Generally, if core/contrib modules don't cover your use case, yes. A custom module would be the route to go to add your own functionality as its needed.
    – Shawn Conn
    Commented Oct 18, 2016 at 19:54

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.