thymeleaf-spring
thymeleaf-spring copied to clipboard
Radio button is replacing the th:name attribute if th:Field and th:value is set
Hi,
I have a spring boot application and one of the screen has a form that displays some question set and each question has 4 multiple choice answers. Only one is the correct answer. I need to show the radio button. I used input radio to show. I have list of questions so using a loop to render on UI and setting th: name, the: value and th: field accordingly. I need to set the th: field to capture the user input. When I run the application it replaces name attribute for all the multiple choices. So now you can select only one option. I tried all the possible ways which I knew but couldn't find the answer. I have written a sample program and replicated this behavior so that you could check and fix it. Spring boot version - 2.3.0.RELEASE thymeleaf-spring - 5.3.0.11 thymeleaf - 3.0.11 I created the public repo on github to replicate this. https://github.com/ashokruhela/thymeleaf-radio.git

have you solved the problem?