1

We are using Drupal 8 for one of our new project and we need to add a country dropdown to the user registration form. I see that we can add a select box through Manage fields section, but how do I make it configurable?

I mean I want to show the values in the select box from a configurable list.

0

It sounds like you've found where you can add user fields (under Administration >> Configuration >> People >> Account settings). Once you've clicked the + Add Field button, you can select List (text), add your Label, and click the Save and Continue button to configure the options you can add to your country select list.

Here is where you add your list of items. The Allowed values list text field is where you can add your selectable items. You can add each country you want, once per line. Once finished, you can click the Save field settings to continue to the final configuration page.

Customize the remaining settings and click the Save setting button to finish adding the country select box for your user account.

  • Hi.. thanks for thsi and it is working. However is there a way to fetch this values from a database table? – codlib Apr 22 '16 at 9:16
  • Are you wanting to fetch the values of the options or the value selected during user registration? – Shawn Conn Apr 23 '16 at 16:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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