title: jQuery: enabling/disabling datepicker
body: <p>In my php-file, I want to use the jQuery Datepicker.</p>
  
  <p>When my file loads, I create the Datepicker disabled.</p>
  
  <p>Then, when a special field in my php-file (it is a form) is filled, I want to enable the Datepicker.</p>
  
  <p>So, initially my Datepicker looks like this:</p>
  
  <pre><code>$("#from").datepicker({
      showOn: "both",
      buttonImage: "calendar.gif",
      buttonImageOnly: true,
      buttonText: "Kalender",
      showAnim: "drop",
      dateFormat: "dd.mm.yy",
      changeMonth: true,
      changeYear: true,
      showButtonPanel: true,
      showWeek: true,
      firstDay: 1,
      dayNamesMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
      weekHeader: "KW",
      disabled: true,
      onClose: function(selectedDate) {
          $("#to").datepicker("option", "minDate", selectedDate);
      }
  });
  </code></pre>
  
  <p>This works just fine, no problem so far. The problem comes, when I want to disable the field.</p>
  
  <p>If a special field is filled, I call <code>$("#from").datepicker('enable');</code></p>
  
  <p>This also works fine, BUT now I want to disable it again if the special field I mentioned it empty again.</p>
  
  <p>Then I use <code>$("#from").datepicker('disable');</code> and the field itself is grayed, but I can still use the field to enter values, the calender pops up and even the calender-image next to the box is clickable.</p>
  
  <p>Anyone has an idea why this is the case? Am I missing something?</p>