Answer the question
In order to leave comments, you need to log in
How to accept drop-down data in Thymeleaf?
this is my code :
- View:
<select id="LoanPeriod" name="LoanPeriod">
<option th:each="loanPeriod: ${loanPeriods}"
th:text="${loanPeriod}"></option>
</select>
List<String> loanPeriods = new ArrayList<String>();
loanPeriods.add("6 months");
loanPeriods.add("9 months");
loanPeriods.add("12 months");
loanPeriods.add("24 months");
model.addAttribute("loanPeriods", loanPeriods);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question