Display datepicker on a link. Follow these steps:-
Add jquery files:
1) http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css
2) http://code.jquery.com/jquery-1.10.1.js
3) http://code.jquery.com/ui/1.10.3/jquery-ui.js
Add a jquery function:
$(document).ready(function() {
$("#dp").datepicker({
onSelect: function(dateText, inst) {
alert(dateText);
},
beforeShow: function (event, ui) {
var $link = $("#datep");
ui.dpDiv.offset({
top: $link.offset().top + 10,
left: $link.offset().left + 10
});
}
});
$("#datep").click(function() {
$("#dp").datepicker("show");
// $( "#dp" ).datepicker( "option", "showAnim", "slide" );
});
});
And here is the HTML for this:-
0 Comment(s)