0

I went through this link

jquery datepicker prevent native click in onSelect

$(this).datepicker({
    minDate: 0,
    beforeShowDay: $.datepicker.noWeekends,
    onSelect: function (dateText, inst) {
        var sdate = $(this).val();
        alert(sdate);
        var cnt = $(".txtdate[value='" + sdate + "']").length;

        if (cnt == '0' || chcurr == sdate) {
            $(this).attr("value", sdate);
        } else {
            alert('You have planned for this date');
            return false;
            // inst.preventDefault();
            //$(this).attr("value", '');
        }
    }

});

But i dint find any solution can any one help me

I have to check if the selected date is already in any inputs or not

I want date picker should not populate date selected in textbox if condition match

Thanks

Community
  • 1
  • 1
M Akela
  • 249
  • 5
  • 21

1 Answers1

0

Try:

beforeShow: function(input, inst) {
  if (myCondition) {
    return false; 
  }
}
karaxuna
  • 26,752
  • 13
  • 82
  • 117