How to block future dates from date field on the form?

Akshatha Sharm1
Kilo Explorer

In Jquery it is easy to disable the future dates by this code $( "#datepicker" ).datepicker({   maxDate: 0 });,

Can anyone please help how to do it here?

4 REPLIES 4

SanjivMeher
Kilo Patron
Kilo Patron

You can refer the below blog



Auto-populating and validating date fields



Please mark this response as correct or helpful if it assisted you with your question.

Sanjiv - thanks for sharing the link, it is very useful. I have one question though, is there way to hide/disable 3days from the current date in the date picker. For example, current date is June 1st and I want to disable June 1st, June 2nd and June 3rd from the date picker so that user can only select the dates from June 4th. This should be applied every time when a user is trying to select future 3 days. Is this something doable or any alternative for this ?

Any help is greatly appreciated.

Thanks!

I don't think thats feasible. We can't customize the date picker and servicenow also doesn't provide any such functionality.


Please mark this response as correct or helpful if it assisted you with your question.

Vishal Khandve
Kilo Sage

Hi,

The given link will help you.

 

thank you,

Vishal