Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove x button in modal?

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">&times;</span><span class="sr-only">Close</span></button>

I though it was an attribute of the modal. Sorry

like image 754
lowcoupling Avatar asked Aug 07 '14 13:08

lowcoupling


People also ask

How do I turn off modal dialog?

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.

How do you toggle modals?

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.

Do modals need a close button?

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.

How do I add a close button on modal pop-up?

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.


1 Answers

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

like image 120
Zim Avatar answered Oct 18 '22 11:10

Zim