Is it right to use this expression in radio buttons in Thymeleaf?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Is it right to use this expression in radio buttons in Thymeleaf?

alexchi
I have a form with field sex and I am using:

<input type="radio"  th:field="*{sexo}" th:errorclass="is-invalid" th:value="Masculino" />Masculino
<input type="radio" th:field="*{sexo}" th:errorclass="is-invalid" th:value="Femenino"/>Femenino

inside the form. This works correctly. The field sexo in the database is populated and is showed in the view.


in the Entity I have

private String sexo

translation
Masculino=Male
Femenino=Female
Reply | Threaded
Open this post in threaded view
|

Re: Is it right to use this expression in radio buttons in Thymeleaf?

Reiju
better use multi-select in our multi-gender society :)