After fetching a json
object containing the list of countries, I am trying to display the selected country name in a select option box. However, I have encountered issues where only a blank value is shown.
Note: The countries
variable holds the json object
with key-value pairs representing the countries. This is used to populate the select options in the view. Additionally, tabs[0].data.country
refers to the country ID that needs to be pre-selected.
Here are some snippets of code that I have attempted:
- Code for displaying the selected country name: https://i.sstatic.net/9zzF5.png
- Code for displaying the select options in the View: https://i.sstatic.net/6rGYE.png
Current Output: https://i.sstatic.net/VkHKi.png