title: Javascript Confirm change into jquery modal dialog
body: <p>I have here a delete record via ajax. I add confirm message if I want to delete the record or not. What I need is change the confirm message into modal dialog <a href="http://jqueryui.com/dialog/#modal-confirmation" rel="nofollow">http://jqueryui.com/dialog/#modal-confirmation</a>.</p>
  
  <p>I want to change this javascript code</p>
  
  <pre><code>if(confirm("All PR and PO in this record will be deleted. Are you want to delete?"))
  </code></pre>
  
  <p>into this jquery modal dialog. Any help?</p>
  
  <pre><code>&lt;script&gt;
  $(function () {
    $("#dialog-confirm").dialog({
      resizable: false,
      height: 140,
      modal: true,
      buttons: {
        "Delete all items": function () {
          $(this).dialog("close");
        },
        Cancel: function () {
          $(this).dialog("close");
        }
      }
    });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Ajax delete</p>
  
  <pre><code>&lt;script&gt;
  $(function () {
    $(".delbutton").click(function () {
      //Save the link in a variable called element
      var element = $(this);
      //Find the id of the link that was clicked
      var del_id = element.attr("name");
      //Built a url to send
      var info = 'name=' + del_id;
      if (confirm("All PR and PO in this record will be deleted. Are you want to delete?")) {
        $.ajax({
          type: "GET",
          url: "delete.php",
          data: info,
          success: function () {}
        });
        $(this).parents(".record").animate({
          backgroundColor: "#fbc7c7"
        }, "fast")
          .animate({
            opacity: "hide"
          }, "slow");
      }
      return false;
    });
  });
  &lt;/script&gt;
  </code></pre>