I am using mdbootstrap for my project. I have check box on which i call ajax to perform some task and get response from php as 1 for success and 0 for failure. So I show modal before ajax call to show processing. modal displays but no closing in ajax response.
This is my modal code
<div class="modal fade" id="process" tabindex="-1" role="dialog" aria-
labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-
keyboard="false">
<div class="modal-dialog modal-dialog-centered" role="document">
<!--Content-->
<div class="modal-content">
<!--Body-->
<div class="modal-body text-center mb-1">
<p>Please Wait</p>
</div>
</div>
<!--/.Content-->
</div>
</div>
<script>
status_val = 1;
ac_no = 2;
$('#process').modal();
$.ajax({
url:"reopen_account.php",
type:"POST",
data:{'reopen':'reopen','status_val':status_val,'ac_no':ac_no},
success:function(output)
{
if (output==1)
{
$('#process').modal('hide');
}
else{
$('#process').modal('hide')
alert('Error occured');
}
}
}
});
</script>
I've used .modal('hide'); its not working out for me.Where i am going wrong.