Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,
i'm new to jquery.In my application am using a date picker.can anyone tell me,How to validate a selected date in Jquery.
the condition is that after user select a date
it will validate that the date is current date or yesterday date.other than this will show error message.if yesterday is saturday or sunday(i.e holiday) then
user should allow to select friday.

Thanks in Advance..
Posted

1 solution

You could use the inbuilt validation feature on the datepicker

$(function() {
    $( "#datepicker" ).datepicker({ minDate: -1D, maxDate: "+1D" });
  });


or if you need to validate after the selection, simply use basic javascript functions to check the date manually after hooking to the datepicker's after selection event.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900