I have several drop down lists in my Thymeleaf pages that look such as:
<select name="institution.serviceDept" th:field="*{serviceDept}">
<option th:each="choice : ${serviceDeptList}"
th:value="${choice.serviceDeptId}"
th:attr="choiceinstitutionId=${choice.serviceDeptId}, institutioninstitutionId=*{serviceDept.serviceDeptId},
showselected=(${choice.serviceDeptId} == *{serviceDept.serviceDeptId})"
th:selected="(${choice.serviceDeptId} == *{serviceDept.serviceDeptId})"
th:readonly="(${choice.serviceDeptId} == *{serviceDept.serviceDeptId})"
th:text="${choice.name}"></option>
</select>
When I view the page, the first value in the list appears selected, and in fact is submitted as the selected value even if its not selected manually. I would prefer to nothing selected by default unless it has already been selected. I removed the " th:selected" and that doesn't make any difference.
Can anyone tell me how to either have nothing selected or perhaps a default value such as "Please select" ?