Remove Datepicker Function dynamically

You can try the enable/disable methods instead of using the option method: $(“#txtSearch”).datepicker(“enable”); $(“#txtSearch”).datepicker(“disable”); This disables the entire textbox. So may be you can use datepicker.destroy() instead: $(document).ready(function() { $(“#ddlSearchType”).change(function() { if ($(this).val() == “Required Date” || $(this).val() == “Submitted Date”) { $(“#txtSearch”).datepicker(); } else { $(“#txtSearch”).datepicker(“destroy”); } }).change(); }); Demo here.

jQuery UI: Datepicker set year range dropdown to 100 years

You can set the year range using this option per documentation here http://api.jqueryui.com/datepicker/#option-yearRange yearRange: ‘1950:2013′, // specifying a hard coded year range or this way yearRange: “-100:+0″, // last hundred years From the Docs Default: “c-10:c+10” The range of years displayed in the year drop-down: either relative to today’s year (“-nn:+nn”), relative to the currently … Read more

Select only specific dates in jQuery UI datepicker (date list comes from AJAX)

Initialize the datapicker only once; tell it to fetch valid dates from a global array Initialize the global array using array literal, update it via AJAX whenever necessary Call the .datepicker(“refresh”) method whenever disabled/enabled dates change — i.e. when you get new results through AJAX Your code does not add leading zeros to the dates … Read more