saribe / eModal

Easy Modal for bootstrap, is a simple way to create modal dialogs using javascript.
http://saribe.github.io/eModal
271 stars 97 forks source link

form ajax errors #24

Closed androidealp closed 8 years ago

androidealp commented 8 years ago

Hi,

How to insert custom code for manipulate the event emodal to close?

My form is loaded into the emodal, if the submit form is not available, i want that the eModal not close, if is available then close emodal.

//this code emodal ajax
buttons: [
                {text: 'Salvar', style: 'info',   close: false, click: save },
                {text: 'Fechar', style: 'danger', close: true}
            ],
//this code event save
function save(){
$.ajax({
sucess:function(data){

if(data.error){
$.notify({data.error.msn});
eModal.close(false); // ????
}else{
$.notify({data.success.msn});
eModal.close(true); // ????
}

}
});
}
saribe commented 8 years ago

You can use remove "eModalclose(false);" and use eModal.close() instead " eModalclose(true);" to close the current modal.

Samuel Ribeiro Pinto

2015-12-15 1:59 GMT+00:00 androidealp notifications@github.com:

Hi,

How to insert custom code for manipulate the event emodal to close?

My form is loaded into the emodal, if the submit form is not available, i want that the eModal not close, if is available then close emodal

//this code emodal ajax buttons: [ {text: 'Salvar', style: 'info', close: false, click: save }, {text: 'Fechar', style: 'danger', close: true} ],//this code event savefunction save(){$ajax({sucess:function(data){ if(dataerror){$notify({dataerrormsn});eModalclose(false); // ???? }else{$notify({datasuccessmsn});eModalclose(true); // ???? }

} }); }

— Reply to this email directly or view it on GitHub https://github.com/saribe/eModal/issues/24.