title: Using jquery / javascript to create a popup confirm box
body: <p>Here is the extract code of how to make a confim box when delete,</p>
  
  <p>For html part:
  A link is to trigger JS code , but it will trigger the php code at same time</p>
  
  <p>For JS part:
  popupbox is triggered</p>
  
  <p>For php part:
  Process the sql query, it should be ok </p>
  
  <p>The problem are:</p>
  
  <ol>
  <li><p>I should use js to trigger the php page?But how can i let the php page know that which ListID i want to delete?</p></li>
  <li><p>What should i put in the html link?</p></li>
  </ol>
  
  <p>Thank you</p>
  
  <p>html</p>
  
  <pre><code>&lt;a id="delete" href='delete.php?id=$set[ListID]'&gt;Delete&lt;/a&gt;
  </code></pre>
  
  <p>Js</p>
  
  <pre><code>$(function(){
    $("#delete").click(function() {
      $.messager.alert('Warning','The warning message');  
      $.messager.confirm('Confirm','Are you sure you want to delete record?',function(r){  
          if (r){  
              alert('ok');  
          }  
      });  
   });
  });
  </code></pre>
  
  <p>php</p>
  
  <pre><code>//connection db
  INSERT  INTO delete_list SELECT * FROM list WHERE ListID=?;    
  INSERT  INTO delete_user_list SELECT * FROM user_list WHERE ListID=?;    
  INSERT  INTO delete_require_attributes SELECT * FROM require_attributes WHERE ListID='2';    
  INSERT  INTO delete_subscriber SELECT * FROM subscriber WHERE ListID=?;    
  INSERT  INTO delete_subscriber SELECT * FROM subscriber WHERE ListID=?;    
  DELETE FROM list WHERE ListID = '1'
  </code></pre>
  
  <p>What if i want to include the list name in the popup box e.g. do you want to delete list A ,where list A is a variable already. The only thing is how can i append it to the popup box</p>
  
  <pre><code>"&lt;tr&gt;&lt;td&gt;".$set['ListName']."&lt;/td&gt;&lt;td&gt;"
  </code></pre>