title: Closing jQuery Datepicker When Closing jQuery Dialog
body: <p>First time here, and more of a web designer than programmer, so be gentle! ;o) Anyway, as the title suggests, I have a dialog window that's opened and within that, a datepicker. What I want it that, if the user opens the datepicker, and then clicks the dialog window's close button, the datepicker is also closed.</p>
  
  <p>Here's what I've got at present:</p>
  
  <pre><code>        &lt;!--// Modal Windows --&gt;        
          $.ui.dialog.defaults.bgiframe = true;
          $(function() {
              $('#advanced_search').dialog({
                  autoOpen: false,
                  width: 600,
                  height: 400,
                  modal: true,
                  resizable: false,
                  draggable: false,
                  title: 'Advanced Search',
              });
              $('.adv_search').click(function() {
                  $('#advanced_search').dialog('open');
              });
          });
  
          &lt;!--// Date Picker --&gt;
          $("#advanced_search .start_date").datepicker({
              dateFormat: 'dd/mm/yy',
              showButtonPanel: true,
              duration: 0,
              constrainInput: true,
              showOn: 'button',               
              buttonImage: '/img/icons/50.png',
              buttonImageOnly: true                               
          });
          $("#advanced_search .end_date").datepicker({
              dateFormat: 'dd/mm/yy',
              showButtonPanel: true,
              duration: 0,
              constrainInput: true,
              showOn: 'button',
              buttonImage: '/img/icons/50.png',
              buttonImageOnly: true                               
          });
  </code></pre>
  
  <p>But I'm a bit flummoxed as to how to do this. Anyone got any advice? It'd be much appreciated!</p>
  
  <p>Thanks
  Phil</p>