Disable Close Modal on Outside Click

元气小坏坏 提交于 2019-12-04 04:20:01

// for disable modal when click outside

$('#modalid').openModal({dismissible:false});

// remove modal-action modal-close in ok button

<a href="#" onClick="check_ganpass()" id="btn_ok" class="waves-effect waves-green btn-flat ">Edit</a>

// insert bellow "Materialize.toast('Data Telah Berubah',4000);"

$('modalid').closeModal();

hope that answer your question. :)

Try this

$('#ModalID').modal({
    backdrop: 'static',
    keyboard: false
})

or in html set data attributes as below

data-backdrop="static" data-keyboard="false"

on popup call

Hope this helps..

if you have only one modal, and are using jquery, you can do :

$('#myModal').modal()[0].M_Modal.options.dismissible = false;
$('#myModal').modal('open');

cheers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!