I have following simple dropdown defined using htmx:
<div>
<select name="region" id="regionSelect" hx-get="/regions" hx-trigger="change">
<option th:each="region : ${regions}" th:value="${region.code}" th:text="${region.name}"></option>
</select>
</div>
with endpoint /regions (@RestController to return JSON):
@GetMapping("/regions")
fun getRegions(): List<RegionLookupV> {
val regions = nbrsRetrievalService.getRegions()
return regions
}
However when I load the html nothing appears on the dropdown. Please help
change the html as follows:
and passed regions from @Controller