Passing query string to a bootstrap modal using javascript/jquery

I would like to pass a query string to a bootstrap modal. I have read the docs and various articles related to passing data to bootstrap modals, but am finding it all to confusing. I need to pull a SKU and PO from a database and have the data pass into a bootstrap modal.

I have created the bootstrap modal, and created the javascript/jquery function that opens the modal via dropdopdown, but dont know how to pass this data (Set SKU: <%= Request.QueryString(“sku”) %>
for PO: <%= Request.QueryString(“po”) %>) to the bootstap modal.

Any help would be appreciated.

<!-- Modal -->
  <div class="modal fade" id="setToHot" role="dialog" >
    <div class="modal-dialog" style="z-index: 1040;">
    
      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title">Set to Hot</h4>
        </div>
        <div class="modal-body">

        <div class="row">
          <table width="100%" cellpadding="0" cellspacing="0">    
    <tr>
      <td width="100%" style="padding-top: 50px; padding-bottom: 5px; text-align: center; color: #000000; font-family: arial; font-size: 18pt; color: #808080">Set SKU: <%= Request.QueryString("sku") %><br /> for PO: <%= Request.QueryString("po") %><br /> to a HOT Status<br /></td>
    </tr>
    <tr>
      <td align="center" style="padding-top: 80px;"><button type="button" class="btn btn-success"><a href="setskuhotsave.asp?id=<%= Request.QueryString("st") %>&po=<%= Request.QueryString("po") %>&sku=<%= Request.QueryString("sku") %>&recvid=<%= Request.QueryString("recvid") %>">Confirm</button></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button type="button" class="btn btn-danger" onclick="javascript: window.close();">Cancel</button>
      </td>
    </tr>
  </table>
    </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>
      
    </div>
  </div>


$("#type_val").on('change', function() {
    if ($(this).val() == 1) {
    $("#setToHot").modal('show');
  }

Hi @glenn171, this looks like some server side templating (ASP?)… so it wouldn’t have anything to do with the JS. If you want to populate the modal dynamically, you can do this with AJAX; otherwise this seems to be an issue with your backend logic. Should I move this topic to another category?