is there any way to remove the closing button (x) in the upper right corner of a modal? The reason why i need it is that the modal contains a mandatory form and I do not want the user to escape from it.
Ooops I didn't realize the close button was actually explicitly added in the code i pasted
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
I though it was an attribute of the modal. Sorry
There are few ways to close modal in Bootstrap: click on a backdrop, close icon, or close button. You can also use JavaScript hide method. Click the button to launch the modal.
To trigger the modal window, you need to use a button or a link. Then include the two data-* attributes: data-toggle="modal" opens the modal window. data-target="#myModal" points to the id of the modal.
Your modal window will need a 'Cancel' button if the user is doing a task where they're entering information. If there's a form in your modal, it's important that the user doesn't click outside of the window to close it.
The close button can be added by using the simple markup with CSS class. The main container for close button is the <button> tag with . close class.
You can remove the close
button markup, and use the data-backdrop="static"
and data-keyboard="false"
attributes to prevent the user from closing it...
http://www.bootply.com/43VI44Y3lG
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With