Created
July 9, 2010 23:59
-
-
Save DoubleBrotherProgrammer/470261 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>20 min datepicker</title> | |
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> | |
<script> | |
// id of HTML field to associate Datepicker with | |
var DT_FIELD = "date_field"; | |
// activate datepicker field when the document is ready | |
$(document).ready(function() | |
{ | |
// show datepicker | |
$( "#"+DT_FIELD ).datepicker( | |
{ | |
// hook up datepicker onSelect handler | |
onSelect: function(dateText, inst) | |
{ | |
inst.text = dateText; | |
} | |
} | |
); | |
} | |
); | |
</script> | |
</head> | |
<body> | |
Click text field to get <a href="http://docs.jquery.com/UI/Datepicker">datepicker</a> | |
<br /><br /> | |
<input type="text" id="date_field" readonly="readonly" /> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment