Forum Discussion
Thank you for answering Robert :smileyhappy: . I have looked at the link you mentioned and have tried something on my page. It shows no error in the preview but on the page, I'm not getting the required functionality. In the select element, options are there but nothing is happening when I'm clicking on them. Is there anything that I'm forgetting? Apart from this what is needed in the code so that I can read the JSON if I've uploaded it in assets of my dev environment? How can I get the URL from the JSON? Do I need to use any REST call for that?
<#assign countries = [ { "name":"Argentina", "url":"https://testurl.com" }, { "name":"Australia", "url":"https://testurl.com" } ]
> <select name="countrySelect" id="countrySelected"> <#list countries as country> <option value ="${country.url}" target="_blank">${country.name}</option> </#list> </select>
Hi pp_01,
You have to use onchange attribute in select statement as following:
<select name="countrySelect" id="countrySelected" onchange="location = this.value;">
<#list countries as country>
<option value ="${country.url}" target="_blank">${country.name}</option>
</#list>
</select>
LMK if this works for you.
Thanks,
Payal
Related Content
- 3 months ago
- 10 months ago