Send data to a Bootstrap modal

print
How to send data to a Bootstrap modal on ‘shown’.  Works with multiple data points.

<a data-toggle="modal" data-id="whateverDataYouArePassing" href="#idOfModal" class="classOfThetrigger btn btn-default">Full Info</a>

$(document).on("click", ".classOfTheTrigger", function () {
   var rowID = $(this).data('id');
   $("#nameOfModal").load("../something/in/here");  
});

 

Share this post:
Related Posts
Centre a form using Bootstrap 4 native controls
Bootstrap modal background doesn’t disappear when modal closes

Leave a Comment