Friday, December 3, 2021

run any ajax oj js function when bootstrap modal open

For any bootstrap modal open, these are by default class. These classes are not mention but this is worked.   

bs modal

These are default class.

js code for call when modal is open.

$(document).ready(function () {

$( '#editModel87' ).on('show.bs.modal', function(){

  //alert("I want this to appear after the modal has opened!");

  setTimeout(

    function() {

      var orgsid = $('#editForm87 input[name="orgs_id"]').attr('data-selectedid');

      var ticketId = $('#editForm87 input[name="key_id"]').val();

      getSeverityListEdit(orgsid,ticketId);

    }, 3000); // run after 3 seconds

  });

});


No comments:

Post a Comment