title: How do I *completely* remove a jQuery UI datepicker?
body: <p>I've got a date text field I wish to only <em>sometimes</em> attach a DatePicker to, because I have some of my own text-handling scripts which handle partial date strings.  Calling .remove or .destroy leaves text formatting behavior on the input field, however, which converts my "8" string into a "8/18/2010".  Even worse, if I start deleting, it steadfastly assumes that, once I reach "8/18/20", I <em>actually</em> wanted "8/18/2020".</p>
  
  <p>What would be the best way to completely, entirely, make-it-like-it-never-was remove the datepicker from my page?  I can also use it if it just ignores text I enter entirely at all times, though in that case I'd prefer it to appear on a double-click / an image-as-button, not always.</p>
  
  <p>edit:</p>
  
  <p>this is all within a jqGrid, where 'selector' is a text box on a date column:</p>
  
  <pre><code>function showPicker(selector) {
      $(selector).datepicker({
          onClose: function() {
              $(selector).datepicker('remove'); 
              // or 'destroy' or $('.datepicker').remove(); or $(this).datepick('remove');
          }
      });
  }
  </code></pre>
  
  <p>This prevents it from coming back, but not from manipulating my text field.  No other code (that I'm aware of) is manipulating that field's contents, just jqGrid watching for the enter-key to send the data.  Looking at the page's generated code, the datepicker div is even still at the bottom.</p>
  
  <p>edit2: I get the exact same behavior if I do this:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.js"&gt;&lt;/script&gt;
  &lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"  /&gt;
  &lt;script type="text/javascript"&gt;
  $(document).ready( function(){
   $("#pickle").datepicker({
    onClose: function(){
     $(this).datepicker('remove');
    }
   });
  });
  &lt;/script&gt;
  &lt;input type="text" id="pickle" /&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>That causes identical behavior to what I'm seeing, but changing it to 'destroy' works <em>here</em> but not on my page.  Odd.</p>