title: jquery datepicker code not working (set specific date as default)
body: <p>I am trying to set the date to a specific one on page load so I'm trying this code:</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
  
  
      $(document).ready(function() { 
  
    var queryDate = new Date();
  queryDate.setFullYear(2009,11,01);
  $('#date').datepicker({defaultDate: queryDate});
  
  
  $("input[type='submit']").click(function(e) {
              e.preventDefault();
              $.post("s.php", $("form").serializeArray(), function(message) {
                  window.location="v.php" 
              });
          });
      });
  
  &lt;/script&gt;
  
  //The form part where is displays the datepicker:
  
  &lt;form action="#" method="POST"&gt;
  &lt;div data-role="fieldcontain"&gt;
  &lt;label for="date"&gt;Date:&lt;/label&gt;
  &lt;input type="date" name="date" id="date" value=""  /&gt;
  &lt;input type="submit" value="submit" /&gt;
   &lt;/div&gt;     
  &lt;/form&gt;
  </code></pre>
  
  <p>The problem is that nothing's changing ... the default is still the current date :o/</p>
  
  <p>Any ideas anyone please?</p>
  
  <p>UPDATE: Tried this code:</p>
  
  <pre><code>var queryDate = new Date(2009,11,01);
  $('#date').datepicker({defaultDate: queryDate});
  $('#date').val(queryDate);
  </code></pre>
  
  <p>And the date is appearing in the input box but the calendar is not in the right month nor date ... Moving foward but still not working.</p>