title: How to change simple javascript confirm into a Jquery dialog box confirm when deleting?
body: <p>I am tying to create a Jquery conform dialog box for delete confirmation. The problem is it doesn't work when I do the Jquery stuff. I am going to post the javascript confirm box so that I can learn on how to change it into the Jquery dialog box confirm.</p>
  
  <pre><code>    //for delete confirm box
   var del = function($element) {
      $('.remove').dialog({
          title: 'Delete',
          resizable: true,
          modal: true,
          hide: 'fade',
          width: 350,
          height: 275,
          buttons: {
            "Delete item": function() {
              $(this).dialog("close");
              $element.data('allow', true); // Allow the next click to proceed
              $element[0].click(); // Hit the DOM native click event
            },
            Cancel: function() {
              $(this).dialog("close");
            }
          }
        });
      }
  
      $('.delete').click(function(e) {
        if (!$(this).data('allow')) {
          e.stopImmediatePropagation();
          del($(this));
        }
      });
  
      $('.delete').click(function() {
          $(this).closest('.delete').hide();
      });
  </code></pre>
  
  <p>PHP code:</p>
  
  <pre><code>&lt;tr align='center'&gt; 
          &lt;td&gt;&lt;font color='black'&gt;&lt;?php echo $test['BookID'];?&gt;&lt;/font&gt;&lt;/td&gt;
          &lt;td&gt;&lt;font color='black'&gt;&lt;?php echo $test['Title'];?&gt;&lt;/font&gt;&lt;/td&gt;
          &lt;td&gt;&lt;font color='black'&gt;&lt;?php echo $test['Author'];?&gt;&lt;/font&gt;&lt;/td&gt;
          &lt;td&gt;&lt;font color='black'&gt;&lt;?php echo $test['PublisherName'];?&gt;&lt;/font&gt;&lt;/td&gt;
          &lt;td&gt;&lt;font color='black'&gt;&lt;?php echo $test['CopyrightYear'];?&gt;&lt;/font&gt;&lt;/td&gt;    
          &lt;td&gt;&lt;a class="edit" href='view.php?BookID=&lt;?php echo $test['BookID'];?&gt;' title="Edit"&gt;Edit&lt;/a&gt;
          &lt;div id="register" &gt;&lt;/div&gt;
          &lt;td&gt;&lt;a class="delete" href ='del.php?BookID=&lt;?php echo $test['BookID'];?&gt;' title="Delete"&gt;&lt;center&gt;Delete&lt;/center&gt;&lt;/a&gt; &lt;!----for deleleting ----&gt;        
          &lt;div id="remove" &gt;&lt;/div&gt;
      &lt;/tr&gt;
  </code></pre>