2

I have two input value like this

<input type="text" th:field="*{itemID}"placeholder="Bidding id" class="form- 
control" required />
------------
<input type="hidden" th:field="*{item.id}" />

okay so how can i put the value of item.id field into itemID ?. I tried like below but it didn't work

<input type="hidden" th:field="*{itemID}" th:value="*{item.id}" 
placeholder="Bidding id" class="form-control" required />

update i tried to make it like this, but it still not work

<input type="hidden" th:name="*{itemID}" th:value="1"
placeholder="Bidding id" class="form-control" required />

1 Answers1

0

Try this :

<input type="hidden" th:field="*{itemID}" th:value="${item.id}" placeholder="Bidding id" class="form-control" required />

replace the * by $ in th:value attribute

akuma8
  • 4,160
  • 5
  • 46
  • 82