Close modal Bootstrap after registering

2

Colleagues

I have a system that the user clicking on the link Register Matter will open the following modal:

However,IwouldlikeyoutoclickSave,andthemodalclosesautomatically.Itriedusingthecodebelow,themodalcloses,butthebackgroundremains:

$(document).ready(function(){$('#submit').click(function(ev){ev.preventDefault();$("#myModal").hide();
    });
});

The background remains:

    
asked by anonymous 27.01.2017 / 20:44

2 answers

5

Substitute:

 $("#myModal").hide();

by:

$("#myModal").modal('hide');

If I'm not mistaken, that's it

    
27.01.2017 / 20:47
1

I had a similar problem, but in a project where I was using AngularJS.

then when the user clicked save, he would perform the following function:

vm.modalFecha = function(){
    $('#modalpesq').modal('hide');
    $('.modal-backdrop').css('display', 'none');
    $('.ng-scope').removeClass('modal-open');
}

I believe that just inserting the line below already solves your problem:

$('.modal-backdrop').css('display', 'none');
    
27.01.2017 / 20:48