title: Open dialog on ajax success call
body: <p>I am struggling to find a way to open a dialog window after a successfull ajax event. At the moment, I am using jquery .html to insert some html into a div, but what I would like to do is to create a dialog window with html instead of using a standard named div. The reason for this is because the values change so a standard response will not do. Is this possibe? </p>
  
  <p>The div in my sample code; #dialog-message, is just an example. Thanks</p>
  
  <p>jquery+dialog code</p>
  
  <pre><code>    //Begin function to submit report form
  
  $(function () {
      $("#frmreport").submit(function () {
  
          var send = $(this).serialize();
  
          $.ajax({
              type: "POST",
              url: "/sample/admin/frm10010.php",
              data: send,
              dataType: "json",
              success: function (msg) {
                  $("#confirm_department").hide();
                  $(function () {
                      $("#dialog-message").dialog({
                          modal: true,
                          buttons: {
                              Ok: function () {
                                  $(this).dialog("close");
                              }
                          }
                      });
                  });
                  //alert('You have succesfully submitted your ' 
                  //   + msg.dept + ' report. Thank you.');
                  //$("#report_result").html("You have succesfully 
                  //   submitted your report. Thank you."+"&lt;br /&gt;&lt;br /&gt;");
                  $("#formShow").hide();
                  $("#formImage .col_1 li").show();
                  $("#frmreport").get(0).reset();
              }
          });
          return false;
      });
  });
  
  // End function to submit report form
  </code></pre>