Wednesday, May 26

Easiest Datepicker Ever

There is a fast, easy way to add a date picker calendar to any form. jQuery! More specifically, jQueryUI.

Include this stuff:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css" type="text/css" media="all" />
Then in your $(document).ready(function(){ add
$('.datepicker').datepicker();
and any text field with the datepicker class will make a beautiful awesome calendar.

No comments: