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:
- <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/base/jquery-ui.css" type="text/css" media="all" />
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
- <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js" type="text/javascript"></script>
-
- <!-- page specific scripts -->
- <script type="text/javascript">
- $(function () {
- $('#txtDate').datepicker({
- beforeShowDay: $.datepicker.noWeekends,
- startDate: '02/25/2011'
- });
- });
- </script>
and here is my html:
- <form name="chooseDateForm" id="chooseDateForm" action="#">
- Test date picker form
- <ol>
- <li>
- Date 1: <input name="date1" id="txtDate" onchange="helloWorld(this.form)" />
- </li>
- </ol>
- </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! :-)