Home / AJAX

Page History: HOW TO Use the Calendar Control

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: 2009/11/18 07:35


The Calendar control enables you to display date picker when focus is moved to an input element.

Image

The page below demonstrates how you can create a Calendar control and attach the control to an input element named travelDate. Notice that the page includes a link element that refers to a Calendar.css Cascading Style Sheet file. You need to include this style sheet in order for the Calendar to appear correctly.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Simple Calendar</title> <link href="../Scripts/extended/Calendar/Calendar.css" rel="stylesheet" type="text/css" /> <script src="../Scripts/start.debug.js" type="text/javascript"></script> <script src="../Scripts/extended/ExtendedControls.debug.js" type="text/javascript"></script> <script type="text/javascript">

Sys.require(Sys.components.calendar, function() { Sys.create.calendar("#travelDate"); }); </script> </head> <body>

<input id="travelDate" />

</body> </html>