Confirmation messages displayed for 'Add, edit, or update' actions

This commit is contained in:
shadab-stack 2023-10-24 10:36:12 +05:30 committed by Dave Syer
parent 6fe21e5d0b
commit 2fe96130c0
5 changed files with 48 additions and 11 deletions

View file

@ -7,8 +7,18 @@
<h2>Owner Information</h2>
<div th:if="${message}" class="alert alert-success" id="success-message">
<span th:text="${message}"></span>
</div>
<div th:if="${error}" class="alert alert-danger" id="error-message">
<span th:text="${error}"></span>
</div>
<table class="table table-striped" th:object="${owner}">
<tr>
<th>Name</th>
@ -73,7 +83,20 @@
</tr>
</table>
<script>
// Function to hide the success and error messages after 3 seconds
function hideMessages() {
setTimeout(function() {
document.getElementById("success-message").style.display = "none";
document.getElementById("error-message").style.display = "none";
}, 3000); // 3000 milliseconds (3 seconds)
}
// Call the function to hide messages
hideMessages();
</script>
</body>
</html>