How to hide Bootstrap 5 modal only on success?

Using bootstrap 5 I have a modal which I show when #truck_modal is clicked which works just fine like so: (this code is at the top of my js file) document.addEventListener(‘DOMContentLoaded’, function(…

Accessing ngx-bootstrap modals outside click event

I’m calling ngx-bootstraps modal from within a ng-template in my applications component. I have built my current setup in a stackBlitz example As you can see, I have added another event to the modals …

How to close the Bootstrap modal after submit?

Here I have a Bootstrap modal. My requirement is when I successfully submit the form with submit button then I want to close the modal after some seconds. The problem here is when I enter some text instead of integer in my input or if I enter some invalid inputs and then when I click the submit button the input field shows the error and the modal closes after some seconds immediately. I don’t want to close the Bootstrap modal if the input field is invalid when clicking submit button. How can I do it ? EDIT: It works perfect