I am utilizing the power of Bootstrap 4 Alerts to showcase error messages, just like in their demo:
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<strong>Holy guacamole!</strong> You should check in on some of those fields below.
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
I am also incorporating AJAX calls for form POST submissions.
The issue I am encountering is that after a user submits and closes the error message, if they submit again and encounter an error, I am not able to display the alert container because it seems to have been removed from the DOM or the page. The DIV element appears to have been destroyed, making it impossible to make it visible again with a d-block class.
Is there a way to make the close button simply 'hide' the container instead of completely removing it? I need to be able to display it again even after the user has closed it.
Thank you! Pat