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
    forms advanced select box
    1
    2
    630
    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 - Auth for devs, built by devs.
      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 - Auth for devs, built by devs.
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        • danD dan has marked this topic as solved on
        • First post
          Last post