Programs, languages and frameworks used: Java IntelIJIdea SpringSecurity Thymleaf Html JavaScript
I have a page product.html on which there is a product. The user clicks on the order item button. I'm sending a signal to the server. If the object is successfully added to the database, I call the same window with an additional bool parameter.
I need to make it so that if bool is true, a modal window pops up with the message the product has been added to the cart.
The problem is that if I use thymeleaf if as a condition to start the window,
<div th:if="${openModal}">
<a href="#openModal">Открыть модальное окно</a>
<div class="product_modal_window" id="openModal">
<div>
<a class="close" href="#close" title="Закрыть">X</a>
<h2>Добавлено</h2>
<p>The product has been added to your cart, continue shopping or go to the cart?</p>
</div>
</div>
</div>
then I do not know how to change the value of openModal from true to false (If at all possible) when clicking the close button.
If I use the option with my_window:target. When selecting, show the window using a pseudo-class and then when clicking on the cross to remove the selection from the window , then I do not know how to determine whether the window should be opened this time or not when starting the window using a variable from the server.