title: How to get the selected date value while using Bootstrap Datepicker?
body: <p>Using jquery and the Bootstrap Datepicker, how do I get the new date value I selected using the Bootstrap Datepicker? 
  FYI, I'm using Rails 3 and Coffescript.</p>
  
  <p>I set up the datapicker using:</p>
  
  <pre><code>&lt;input id="startdate" class="span2 datepicker" type="text" value="" name="startdate" default="2013-05-21" data-date="2013-05-21" data-behavior="datepicker"&gt;
  &lt;%= submit_tag 'Get Data using date', :id =&gt; 'get_data' %&gt;
  
  $(".datepicker").datepicker
        endDate: new Date
        format: "yyyy-mm-dd"
        autoclose: true
        minViewMode: 1
        todayBtn: "linked"
  </code></pre>
  
  <p>When a user clicks on the "get data using date" button next to it, I will use jQuery to get the new date value set by the datepicker, prevent the form from submitting and run an ajax request using that date value. All the ajax is running well, except for getting the correct new date value. I tried both of the following and it doesn't give me the new date, it only return the defaults I initially set.</p>
  
  <pre><code>sd1 = $('#startdate').attr('value')
  console.log sd1
  
  sd2 = $('#startdate').attr('data-date'))
  console.log sd2
  </code></pre>
  
  <p>I am feeling really stupid right now, but I can't find out how to get the new date value set by the bootstrap datepicker.</p>