title: HTML modal popup, display results by calling php
body: <p>Hopefully a simple question regarding dynamically populating results to a popup model rather than opening a new page.</p>
  
  <p>I have a html table of results based on a php query, when I highlight a row and click the edit button a new window opens and displays more details about the selected item. This is working fine but now I would like to have to contents display in a model instead of opening a new page.</p>
  
  <p>Below is the JavaScript for the <strong>edit</strong> button that does work.</p>
  
  <pre><code>$(function(){
      $('#btnEdit').click(function(e) {
          var value = $("#tblTickets tr.selected td:eq(4)").html();
          window.open("helpdesk_ticket_details.php?ID="+value);       
      });
  });
  </code></pre>
  
  <p>Now if I modify the code slightly like below the model box displays but I'm not sure how to dynamically fill it based on my table selection.</p>
  
  <pre><code>$(function() {
      var modal = document.getElementById('myModal');
      $('#btnEdit').click(function(e) {
          var value = $("#tblTickets tr.selected td:eq(4)");
          modal.style.display = 'block';
      });
  });
  </code></pre>
  
  <p>Any help on this is appreciated. If you need anymore information please let me know.</p>
  
  <p>Thanks</p>