How to hide Bootstrap modal with javascript?

I’ve read the posts here, the Bootstrap site, and Googled like mad – but can’t find what I’m sure is an easy answer… I have a Bootstrap modal that I open from a link_to helper like this: <%= link_to “New Contact”, new_contact_path, {remote: true, ‘data-toggle’ => ‘modal’, ‘data-target’ => “#myModal”, class: “btn btn-primary”} %> In … Read more

Close Bootstrap Modal

I have a bootstrap modal dialog box that I want to show initially, then when the user clicks on the page, it disappears. I have the following: $(function () { $(‘#modal’).modal(toggle) }); <div class=”modal” id=’modal’> <div class=”modal-header”> <button type=”button” class=”close” data-dismiss=”modal” aria-hidden=”true”>×</button> <h3 id=”myModalLabel”>Error:</h3> </div> <div class=”modal-body”> <p>Please correct the following errors:</p> </div> </div> </div> … Read more

Prevent Bootstrap Modal from disappearing when clicking outside or pressing escape? [duplicate]

This question already has answers here: Disallow Twitter Bootstrap modal window from closing (24 answers) Closed 3 years ago. I’m using the Twitter Bootstrap modal as a wizard window, and would like to prevent the user from closing it when clicking outside of the modal or when pressing escape. Instead, I want it to be … Read more

Disable click outside of bootstrap modal area to close modal [duplicate]

This question already has answers here: Disallow Twitter Bootstrap modal window from closing (24 answers) Closed last year. I am making a bootstrap website, with a couple of Bootstrap ‘Modals’. I’m trying to customize some of the default features. Problem is this; You can close the modal by clicking on the background. Is there anyway … Read more

Disallow Twitter Bootstrap modal window from closing

I am creating a modal window using Twitter Bootstrap. The default behavior is if you click outside the modal area, the modal will automatically close. I would like to disable that — i.e. not close the modal window when clicking outside the modal. Can someone share jQuery code to do this? 24 s 24 I … Read more

Bootstrap modal appearing under background

I have used the code for my modal straight from the Bootstrap example, and have included only the bootstrap.js (and not bootstrap-modal.js). However, my modal is appearing underneath the grey fade (backdrop) and is non editable. Here’s what it looks like: See this fiddle for one way to reproduce this problem. The basic structure of … Read more