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 closed when the user presses the finish button. How could I achieve this scenario?
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
-
Why does the box-shadow property not apply to a
This code will prevent the modal from closing if you click outside the modal.
simply add data-backdrop and data-keyboard attribute to your button on which model is open.
i think this codepen can help you prevent modal close css and bootstrap
Your code is working when i click out side the modal, but if i use html
input
field inside modal-body then focus your cursor on that input then pressesc
key the modal has closed. Click hereYou can use the code below
to change the default behavior.
The following script worked for me: