0

While I first click this #btnRequestedProviderSelect button, bootstrap modal is not showing popup. But I second click it will come why?

$("#btnRequestedProviderSelect").click(function () {
  $("#hdnORProvider").val('Requested');
  $.ajax({
    type: "Get",
    async: false,
    url: settings.ProviderSearchPopupURL,
    data: {
      coverageID: 0,
      fromPage: settings.Frompage, HPID: $('#MemberHealthPlanID').val(),
      LOBID: $("#MemberLOBID").val(), IPAID: $("#MemberIPAID").val()
    },
    success: function (data) {
      $("#divProviderSearch").html(data);
      $("#divProviderSearchPopup").modal();
      $('#divProviderSearchPopup').modal({
        keyboard: false
      });
      $('#divProviderSearchPopup').modal('show');
    }
  });    
});
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
Partho63
  • 3,117
  • 2
  • 21
  • 39
Mani M
  • 1
  • Did you get errors in browser console? Also try to remove `async: false` and provide contents of `data` in success result. – Tetsuya Yamamoto Jan 31 '19 at 05:32
  • if i remove async:false means it will go to some other ajax without complete this...and data is also fine – Mani M Jan 31 '19 at 06:25
  • Anyone faced issue like this ??? – Mani M Jan 31 '19 at 06:29
  • Is this already tried: `$('#divProviderSearchPopup').modal('toggle');`? Also consider to read [this](https://stackoverflow.com/questions/36672304/bootstrap-mymodal-modalshow-is-not-working) and [this](https://stackoverflow.com/questions/32482680/pop-up-bootstrap-modal-on-success-ajax-call), ensure that you're not loaded same script twice. – Tetsuya Yamamoto Jan 31 '19 at 06:32
  • u told that $('#divProviderSearchPopup').modal('show'); for this i have to use $('#divProviderSearchPopup').modal('toggle') ryt?? – Mani M Jan 31 '19 at 06:37
  • I'm not getting any issue like this Uncaught TypeError: $(...).modal is not a function......and even if i will try this also how can i use {keyboard: false} on modal $('#divProviderSearchPopup').modal('toggle'); – Mani M Jan 31 '19 at 06:43
  • Were you able to solve this issue – Nayana Setty Jul 08 '21 at 17:23

0 Answers0