The following is written in thymeleaf, but the initial value is not selected.
<input type="radio"th:value="${item.id}"th:field="*{selectId}"checked/>
The problem seems to be using th:field (it is initially selected when th:field is removed), but if th:field is removed, the form does not have a value and cannot pass the radio button value to the server side.
What should I write in this case?
spring thymeleaf
th:checked="${item.key=='******'}"
The initial value is selected as the one specified in ******
.
© 2024 OneMinuteCode. All rights reserved.