I have a jquery UI datePicker on my page. I have a text box that displays the date. The code:
$("#cal").datepicker({
minDate: new Date(),
defaultDate: new Date(),
buttonImage:
'/images/calendar.gif',
constrainInput: false,
closeText: 'Close',
showButtonPanel: true,
showButtonText: 'Choose a date',
buttonImageOnly : true,
showOn : 'button'
});
$("#till").datepicker('setDate', today);
I want to disable this under some conditions. I use the following code to disable:
$("#cal").datePicker('disable');
It crosses out the text box, but the image is still clickable. The problem is in IE, the date picker pops up but does not close when the image button associated with the date picker is pressed.
I also tried to associate the onclick function with the image to make it non-clickable. But that does not work.
How to make the date select image button unavailable if the date switch is off.
Any help would be appreciated.
Thanks Farzana