0

I'm trying to open a new pop up window after the existing modal window is closed. This is the modal window script. I'm not sure where I should add new pop up window script to be added. I'm using a script to call a function openEnquiryModal(). In the controller this is the redirection script given after the openEnquiryModal window is closed:

PHP Code:

return redirect ( 'enquiries' )->with ( 'status', 'Enquiry added successfully' );

HTML Code:

<button type="button" class="btn btn-primary" onclick="openEnquiryModal()">
    <i class="material-icons">add</i>ADD ENQUIRY
</button>

JQUERY Code:

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();
        }
    });
}
Pankaj Makwana
  • 3,030
  • 6
  • 31
  • 47
Sid Menon
  • 23
  • 2
  • 9

0 Answers0