<!-- Your date picker input element -->
<input type="date" th:field="*{selectedDate}" />
<!-- Display an error message if the selected date is smaller than the current date -->
<div th:if="${yourJavaFunction(*{selectedDate})}">
<span style="color: red;">Error: Selected date cannot be in the past.</span>
</div>
1条答案
按热度按时间6jjcrrmo1#
将Thymeleaf的条件表达式与th:if属性沿着使用