title: jQuery Popup to Delete
body: <p>I am trying to make a jQuery popup to delete the record from table.</p>
  
  <p>Here's what I am doing to call my function:</p>
  
  <pre><code>echo '&lt;div id="dialog-confirm"&gt;'.'&lt;td&gt;' . '&lt;input type="image" src="delete.png" id = "deleteconfirm" style = "height:20px;margin-left :8px;" onclick = "deleterecord('.$row['id'].')"&gt;' . '&lt;/td&gt;'.'&lt;/div&gt;';
  </code></pre>
  
  <p>And here's my function:</p>
  
  <pre><code>function deleterecord ( id ) {
      function fnOpenNormalDialog() {
      $("#dialog-confirm").html("Confirm Dialog Box");
  
      // Define the Dialog and its properties.
      $("#dialog-confirm").dialog({
          resizable: false,
          modal: true,
          title: "Modal",
          height: 250,
          width: 400,
          buttons: {
              "Yes": function () {
                  $(this).dialog('close');
                  callback(true);
              },
                  "No": function () {
                  $(this).dialog('close');
                  callback(false);
              }
          }
      });
  }
  
  $('#deleteconfirm').click(fnOpenNormalDialog);
  
  function callback(value) {
      if (value) {
          window.location.href = 'delete_ven.php?id=' + id;
      } else {
          alert("Rejected");
      }
  } 
  }
  </code></pre>
  
  <p>Any help? It's not working.</p>