title: JQuery UI dialog reload original content
body: <p>I'm loading a dialog from a div</p>
  
  <pre><code>&lt;div id="dialog-message" title="Send Message" style="display: none;"&gt;
  &lt;form id ="form_message"&gt;
  &lt;textarea name="message_field" id="message_field" rows="8" cols="62" class="ui-widget-content ui-corner-all" style="resize: none;"&gt;&lt;/textarea&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>creating the dialog inside the $(document).ready(function() and opening it using a link.
  On submit of the dialog i change the content of the dialog with the return message, and the user can close the window.</p>
  
  <pre><code>// dialog create
  $("#dialog-message").dialog({
  autoOpen: false,
  resizable: false, width: 520, height: 320,
  modal: true,
  buttons: {"Send": { text: "Send", id: "btn_send", click: function () {},
  close: function() {if($('#form_message').length) {$(this).find('form')[0].reset();} }
  });
  
  //link to open dialog
  $('#dialog_link').click(function(){$("#dialog-message").data("msg_data", {msg_from: 14, msg_to: 15}).dialog("open"); return false; });
  
  //operations made on submit dialog
  $('#btn_send').hide();
  $('#dialog-message').html(data.error);
  </code></pre>
  
  <p>The problem i have is that once you open the dialog again, the return message remains, and it's not loading the original div content.
  how can i achive this? i tried to destroy the dialog on the close event, but then the dialog doesn't reopen at all.</p>