0

How to deselect the value in Jquery Datepicker? i tried the following code but it doesn't work. any other idea?

 if (this.displayClear) {
       $pop.append(
          $('<a href="#" id="dp-clear">' + $.dpText.TEXT_CLEAR + '</a>')
             .bind(
                'click',
                function()
                {
                      c.clearSelected();
                      //help! reset the value to '': $(this.something).val('')
                      c._closeCalendar();
                }
             )
       );
    }
Madhavan
  • 232
  • 1
  • 7
  • 15

1 Answers1

1

Try this. This will allow you to use your backspace to clear selected value from jquery datetime picker

$("#txtestimatestartdate").datepicker().keyup(function (e) {
        if (e.keyCode == 8 || e.keyCode == 46) {
            $.datepicker._clearDate(this);
        }
    });
Arun
  • 83
  • 4