在使用 th:field 标签的时候,对 select 标签不起作用是正常的。th:field 标签是用来为表单元素绑定属性值的,它通常用在 input、textarea 和 button 等标签上。
如果要在 select 标签上使用 th:field 标签,可以使用 th:field="*{字段名}" 的形式。例如:
<form>
<select th:field="*{字段名}">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
</form>