Spring Boot same input for 2 fields(thymeleaf) | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Spring Boot same input for 2 fields(thymeleaf)

In a html is it posible to assign to the same field multiple objects? If yes which is the syntax? Example: <form th:object="${object1}"> <input th:field="${object1.name}"> </form> So for this input if it's posible to assign a second object like: <form th:object="${object1, object2}"> <input th:field="${object1.name, object2.name}"> </form> For me it doesn't work with this syntax"invented" by me

8th Oct 2020, 2:40 PM
ztonaz
ztonaz - avatar
1 ответ
0
It will be like this: <form> <input th:value="${object1.name + object2.name}"> </form> and the same way to `th:name` and `th:id`. I don’t know if this works for `th:field`. Just try it out.
30th Nov 2020, 12:53 AM
o.gak
o.gak - avatar