title: How do I get selected date set by jQuery UI Datepicker
body: <p>I'm setting the start date of an event using jQuery UI Datepicker. Now I need to retrieve the selected date. I'm trying to use <code>$('#startDate').datepicker('getDate')</code>, but this returns <strong>NULL</strong>.</p>
  
  <p>Using FirBug, I see that the input value is nothing :-<br>
  <code>&lt;input type="text" name="startDate" value="" id="startDate" class="hasDatepicker"&gt;</code></p>
  
  <p>So how can I retrieve the selected date?</p>
  
  <p><strong>PS. :</strong> 
  I found an old thread regarding he exact same issue.<br>
  <a href="http://old.nabble.com/ui.datepicker-trouble-td17846951s27240.html" rel="nofollow noreferrer">http://old.nabble.com/ui.datepicker-trouble-td17846951s27240.html</a>  </p>
  
  <p>But the solution here does not work for me. I just get an error message :- </p>
  
  <blockquote>
    <p>uncaught exception: Missing instance data for this datepicker</p>
  </blockquote>
  
  <p><strong>UPDATE :</strong></p>
  
  <p>I'm able to retrieve the selected date by using this code:</p>
  
  <pre><code>  var arr = $('#newEvent').serializeArray();
    alert(arr[2].value);
  </code></pre>
  
  <p>But this is by far the best way....b/w any other suggestions is appreciated.</p>