title: Attaching to jQuery Datepicker Blur Event
body: <p>I'm working on a jQuery plugin for use with textboxes and I would like it to work with jQueryUI widgets that make use of textboxes, such as the datepicker. This is causing me problems because it seems that the blur event on the datepicker is thrown before the value is actually set. </p>
  
  <p>A workaround I have used is to set a timeout before executing my code to allow time for the datepickers value to be set. See below code:</p>
  
  <pre><code>$(this).blur(function() {
      // $(this).val() == ""
      var elem = $(this);
      setTimeout(function() {
          //elem.val() != ""
      },100);
  });
  </code></pre>
  
  <p>I am not sure this workaround is the best solution to the problem or even if it will always work. If I set the timeout to 10 milliseconds instead of 100, it does not work - I'm worried if code is slow to execute for whatever reason 100 may not always be enough.</p>
  
  <p>Can anyone think of a better solution to this problem? </p>