The problem is that when I clear the dates (by deleting the textbox values), th
$("#datepicker").datepicker({ showButtonPanel: true, closeText: 'Clear', onClose: function () { var event = arguments.callee.caller.caller.arguments[0]; if ($(event.delegateTarget).hasClass('ui-datepicker-close')) { $(this).val(''); } } });