title: jQuery datepicker does not update value properly
body: <p>On the website I'm currently working I have a form to add a event. This event needs a date which the user selects using a jQuery datepicker. A date can only have one event. So I want to check the date the user insert in the datepicker. I tried doing this by getting the value after the user has selected the date. The problem is however, the datepickers doesn't update his value right away. </p>
  
  <p>I made a JSFiddle to show the problem. When you pick a date the span updates and shows the value of the datepicker. But as you can see the first time it is blank, and the second time it shows the previous selected date. So the datepickers does not update is value right away. How can I fix this? </p>
  
  <p>I looked trough other similar questions here on stackoverflow but their solutions didn't work for me.</p>
  
  <p><strong>JSFiddle:</strong> <a href="http://jsfiddle.net/kmsfpgdk/" rel="nofollow">http://jsfiddle.net/kmsfpgdk/</a></p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input type="text" id="datepicker" name="date" /&gt;
  &lt;span id="data"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>$('#datepicker').datepicker();
  
  $('#datepicker').blur(function () {
      var val = $(this).val();
      $('#data').text(val);
  });
  </code></pre>