form submit modal auto close bootstrap modal code example
Example 1: bootstrap modal popup clear data with out click event
$('#yourModalName').on('hidden.bs.modal', function(event) {
$('#yourModalName').empty();
});
Example 2: bootstrap modal prevent close
$('#myModal').modal({backdrop: 'static', keyboard: false})