Validate Date of Birth is not greater than current date using jQuery
Read my series of articles about jQuery UI datepicker here.
All I needed to do is to stop datepicker control to disable dates greater than today's date. jQuery UI datepicker control provides an option to set the max date. If its value is set to "-1d" then all the dates after current date will be disabled.
Note: I have set the year range statically but this can be set programatically.
$(document).ready(function(){ $("#txtDate").datepicker( { yearRange: '<%=(System.DateTime.Now.Year - 150).ToString()%>: <%=System.DateTime.Now.Year.ToString() %>', changeMonth:true, changeYear:true, maxDate: '-1d' }); });
Read my series of articles about jQuery UI datepicker here.
Also read, Validate Date using jQuery
Feel free to contact me for any help related to jQuery. I will gladly help you.