Not able to do more than one thing with jquery datepicker

Not able to do more than one thing with jquery datepicker

Hi everyone,

I'm new to jQuery, and it seems like an amazing tool once I figure out what I'm doing wrong.  I'm using the awesome datePicker plugin, but am just not getting something right.  I can't seem to be able to get datepicker to do more than one thing.  To help myself figure out what Im doing wrong, I created a very simple example: 

  1. <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/base/jquery-ui.css" type="text/css" media="all" />
  2.      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
  3.      <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js" type="text/javascript"></script>
  4.         
  5.         <!-- page specific scripts -->
  6. <script type="text/javascript">
  7.              $(function () {
  8.                  $('#txtDate').datepicker({
  9.                          beforeShowDay: $.datepicker.noWeekends,
  10.                  startDate: '02/25/2011'
  11.                  });
  12.              });
  13.    </script>


and here is my html: 

  1. <form name="chooseDateForm" id="chooseDateForm" action="#">
  2. Test date picker form
  3. <ol>
  4. <li>
  5. Date 1: <input name="date1" id="txtDate" onchange="helloWorld(this.form)" />
  6. </li>
  7. </ol>
  8. </form>
My onchange event just throws an alert, and seems to alert fine.  The beforeShowDay function seems to run fine, but startDate doesn't work.  In a different example, I had startDate working, but I couldn't get beforeShowDay to work at all.  I've googled my brain out and am just missing something.  Any help would be greatly appreciated.  Thanks! :-)