FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Capturing country code while displaying name in the advanced registration forms

    Scheduled Pinned Locked Moved Solved Q&A
    formsadvancedselect box
    2 Posts 1 Posters 1.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • danD
      dan
      last edited by

      Hiya,

      I want to capture country code in my advanced registration form. I see that I can add values to the dropdown, but whatever value I add ("United States") seems to be the value displayed ("United States").

      How can I add "US" and have "United States" displayed?

      --
      FusionAuth - Identity Without Constraints
      https://fusionauth.io

      danD 1 Reply Last reply
      Reply Quote 0
      • danD
        dan @dan
        last edited by

        Currently the way you would do that is by using the short version in the custom field definition. This will be the programatic value that is persisted. For example:

        US
        DE
        

        Then in your message bundle (managed by the theme), you can translate those values into a more human readable option.

        US=UNITED STATES
        DE=GERMANY
        

        If we do not find a localized key, we will just use the key as the value which would then render as <option value="US">US</option>.

        --
        FusionAuth - Identity Without Constraints
        https://fusionauth.io

        1 Reply Last reply
        Reply Quote 0
        • danD dan has marked this topic as solved on
        • danD dan moved this topic from Q&A on
        • danD dan moved this topic from Frequently Asked Questions (FAQ) on

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post