title: Cakephp JS helper with jQuery datepicker
body: <p>I switched from select boxes to the jQuery datepicker with Cakephp 2.3.8 and I'm wondering if there's a way that I can trigger a POST request with the JS helper when the date is selected. I send POST request to look up values for that specific date. I know it can be done with just jQuery/AJAX, but if I can use the JS helper I'd prefer that since I already have it implemented from when I used the select boxes.</p>
  
  <p>For example, the request will be triggered when the input is clicked, but not when a date is actually selected</p>
  
  <pre><code>$this-&gt;Js-&gt;get('#arrival_date')-&gt;event('click', //also tried change
      $this-&gt;Js-&gt;request(array(
          'controller'=&gt;'registration',
          'action'=&gt;'room_number'
          ), array(
          'update'=&gt;'#RegistrationRoomId',
          'async' =&gt; true,
          'method' =&gt; 'post',
          'dataExpression'=&gt;true,
          'data'=&gt; $this-&gt;Js-&gt;serializeForm(array(
              'isForm' =&gt; false,
              'inline' =&gt; true
              ))
          ))
  );
  </code></pre>
  
  <p>I know I can get it to work with something like this, but since I switched to the datepicker from just using select boxes for the date, I already have everything else implemented for the JS helper. The only issue is getting the JS helper to trigger when a value is selected.</p>
  
  <pre><code>jQuery(function($){
      $(document).ready(function() {
          $("input.datepicker").datepicker({
              onSelect: function(date){
                  check_availability(date);
              },
              dateFormat: 'mm-dd-yy',
              yearRange: "-100:+50",
              changeMonth: true,
              changeYear: true,
              constrainInput: false,
              showOn: 'both',
              buttonImageOnly: true
          });
      });
  });
  
  
  function check_availability(date){
      //do stuff here
  }
  </code></pre>