我试图在现有的模态窗口关闭后打开一个新的弹出窗口。这是模态窗口脚本。我不知道应该在哪里添加要添加的新弹出窗口脚本。我使用脚本来调用函数openEnquiryModal()
。在控制器中,这是在openEnquiryModal
窗口关闭后给出的重定向脚本:
PHP代码:
return redirect ( 'enquiries' )->with ( 'status', 'Enquiry added successfully' );
HTML代码:
<button type="button" class="btn btn-primary" onclick="openEnquiryModal()">
<i class="material-icons">add</i>ADD ENQUIRY
</button>
JQUERY代码:
function openEnquiryModal(){
@if (!empty($customer))
var strUrl = 'getEnquiryModalForPnr?
fromlist = true & activity = Enquiry & customer_id = ' +document.getElementById('customer_id').value;
@ else
var strUrl = 'getEnquiryModalForPnr?fromlist=true&activity=Enquiry';
@endif
$.ajax({
url : strUrl,
beforeSend : function() {
$("#loading-image-enquiry").show();
},
complete : function() {
$("#loading-image-enquiry").hide();
},
success : function(data) {
$('#enquiryMappingModal').html("");
$('#enquiryMappingModal').html(data);
$('#addEnquiry').modal('show');
$("#loading-image-enquiry").hide();
}
});
}