Disable Future or Previous Dates from Date Picker

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
256789023750
User
Posts: 8

Disable Future or Previous Dates from Date Picker

Post by 256789023750 »

I warmly greet you all.
I am currently working on a booking application and as part of enhancing validation for date i would wish to limit the user from picking a date older than today.
I also wish to have a similar case but for picking the date of birth where by someone should not be able to pick future dates.
If anyone knows how i can achieve those two validation techniques using a date picker in phpmaker 12 or 2017, please come to my rescue.
Thank you so much


arbei
User
Posts: 9292

Post by arbei »

You can control the available years by setup the range in settings of JSCalendar in Client Scripts.

For example:
$(document).on("calendar", function(e, args) {
args.settings.range = [2017,2018]; // only 2017 and 2018 avaliable
});


Post Reply