Как заполнить поле input type="time" в Thymeleaf
Проект Spring-Boot + Thymeleaf При открытии формы html не заполняется данными поле input type="time" Причем вот так работает:
<input type="time" class="form-control" id="inputTime" th:value=${CarEntity.timeOperation} required>
а вот так:
<input type="time" class="form-control" id="inputTime" th:field="*{timeOperation}" required>
или так:
<input type="time" class="form-control" id="inputTime" th:field="*{timeOperation}" th:value=${CarEntity.timeOperation} required>
поле остается пустым. Вот код формы записи методом POST:
<form id="f-03" th:method="POST" th:action="@{/car/edit/{id}(id=${carEntity.getId()})}" th:object="${carEntity}">
<input type="time" class="form-control" id="inputTime" th:value=${CarEntity.timeOperation} required>
<button type="submit" value="save">Сохранить</button>
</form>
Ответы (1 шт):
Автор решения: Мазанов Кирилл
→ Ссылка
Так а что не заполняется-то? Нажимаете "Выполнить код", кликаете левой кнопкой мыши на иконку часов - и выбираете время.
