Deselect value in Jquery Datepicker?

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();
                }
             )
       );
    }

Answers


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);
        }
    });

Need Your Help

How to Highlight navbar Menu Items in using TagHelpers (Asp.Net.MVC6 6.0.0-rc1.0-final)

asp.net-core asp.net-core-mvc tag-helpers

I want to generate class="active" in menu links in asp.net 5 1.0.0-rc1-final, to highlight the active menus of the navbar in _Layout.cshtml.

NSManagedObjectContext does not notify observer of changes for transients

ios core-data formatting nsnotificationcenter key-value-observing

I am trying to clean up some transient property recalculation events. In development I have just used a very broad stroke of updating on almost all changes. Now I am trying to determine the best pr...