Is there any other way by which I cannot allow the user to select next months. I had gone through some threads but I don't want to disable both next and previous buttons by using step functionality as directed in this link.
function bindPicker() {
$("input[type=text][id*=Date]").datepicker({
changeMonth: true,
changeYear: true,
yearRange: "-100:+0",
showOn: "both",
buttonImage: "../../images/Calender.png",
buttonImageOnly: true,
dateFormat: "M-yy"
});
}
Well if you are looking to simply remove the next/previous options and only use a forced month in your code, you can use CSS.
.ui-datepicker-next,.ui-datepicker-prev{display:none;}
This will just remove the next/prev buttons all together. Then if need be you can even put in like some .toggle() code to show/hide them when needed.
Try setting the maxDate option to 0, this set the max date to +0 days from today.
$(".datepicker").datepicker({maxDate: '0'});
More info: http://api.jqueryui.com/datepicker/#option-maxDate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With