I want to set maximum limit in JQuery Datepicker so that the user can't pick date after current date. Currently I'm using http://jqueryui.com/datepicker/ plugin. How to set maximum limit in JQuery datepicker ?
Asked
Active
Viewed 141 times
4 Answers
1
you can validate by Jquery
$(document).ready(function(){
if($("#datepicker").val() == ''){
alert("Please Select Your date");
}
});

ankit singh
- 367
- 1
- 3
- 13
1
try this- just in the datepicker function you are using pass these parameters
$("#date").datepicker({
onSelect: function(selectedDate) {
$( "#date1" ).datepicker( "option", "maxDate", selectedDate);
}
});

sunny
- 1,156
- 8
- 15
0
Try
$("#date").datepicker("option","maxDate",0);
or
$("#date").datepicker("option","maxDate",new Date());
Working Demo
$(function () {
$("#date").datepicker({
maxDate: 0
});
});

Tushar Gupta - curioustushar
- 58,085
- 24
- 103
- 107