Problem : I am working with Bootstrap Modal to display pop up window but whenever i click outside the modal or press escape button it goes disappear but i want to manually close it by clicking close button on modal pop up.
Solution : To disable on click set backdrop option as static and to prevent closing of the modal by esc button set keyboard option as false as shown in below given code.
1. If you are using javascript for displaying Modal.
2. If you are using data attributes on html or jsp.
Solution : To disable on click set backdrop option as static and to prevent closing of the modal by esc button set keyboard option as false as shown in below given code.
1. If you are using javascript for displaying Modal.
$('#myModal').modal({backdrop: 'static', keyboard: false})
2. If you are using data attributes on html or jsp.
<button data-backdrop="static" data-keyboard="false" data-target="#myModal"
data-toggle="modal">
Click Here for Modal
</button>`
0 comments:
Post a Comment