Answered

Define keys for a DropDown

  • 8 February 2023
  • 3 replies
  • 77 views

Userlevel 5
Badge +5

Hello,

I have created a dropdown with a list of countries as the values.
I am wondering if I can define the keys, using the iso code of the countries

icon

Best answer by Liz 9 February 2023, 21:59

View original

3 replies

Userlevel 7
Badge +5

Hi again, @jeremielp ! If you’re referencing the letter on each dropdown option, this isn’t possible to adjust at this time. 

Userlevel 5
Badge +5


No, that was not what i was referring to.

I was referring to be able to get a different value than what is displayed in the form.

For example, if I select Spain in a standard dropdown, the form will send me back ES, which is the ISO code, instead of the text that the user sees.

<select name="countries" id="countries">
  <option value="FR">France</option>
  <option value="US">USA</option>
  <option value="ES">Spain</option>
  <option value="CL">Chile</option>
</select>


My main use case is the country dropdown. Why is that important? My websites usually have 2/3 languages, so getting the name of the country in the local language instead of the ISO code means having mapping tables for each language, while I could just get the data straight at first.

That could be fixed by having, in the Dropdown definition something like this

FR|France
US|USA
ES|Spain
CL|Chile

key|text_to_show_to_user


If you can't/don't want to add such a broad feature, an alternative would be to have a "Country" question, or a dropdown in the "Contact" card for the field country. You have already built a Country dropdown for the international part of the phone field, so that would great to be able to use this separately.

Userlevel 7
Badge +5

Ah, got it, @jeremielp ! We don’t have this feature, but I can share this with the product team. 

Reply