DKK007
PCGH-Community-Veteran(in)
Ich hab ein Problem mit Thymeleaf.
Ich möchte in die Länderliste (s.u.) das Select-Tag also selected="selected" einfügen, wenn ${country} == ${originOld} erfüllt ist.
So hab ich es versucht, das läuft aber nicht:
Ich möchte in die Länderliste (s.u.) das Select-Tag also selected="selected" einfügen, wenn ${country} == ${originOld} erfüllt ist.
HTML:
<select name="origin" >
<option >---- Select ----</option>
<option th:each="country : ${countrys}"
th:text="${country}"
>
</option>
</select>
So hab ich es versucht, das läuft aber nicht:
HTML:
<select name="origin" >
<option >---- Select ----</option>
<option th:each="country : ${countrys}"
th:if="{"${country} == ${originOld}" selected="selected" }"
th:text="${country}"
>
</option>
</select>
