I want to have the JQuery Datepicker open when the user clicks on an image. There is no input field where the selected date appears afterwards; I'm just going to save the entered date to the server via Ajax.
Currently I have this code:
<img src='someimage.gif' id="datepicker" />
$(document).ready(function() {
$("#datepicker").datepicker({
changeMonth: true,
changeYear: true,
}).click(function() { $(this).datepicker('show'); });
});
But nothing happens when I click on the image. I have also tried saving the result of the datepicker() call to a global var and then calling datepicker('show') from the onclick() event of the image, but same result.