How to restrict Date field to a minimum/maximum value

Nilesh11
Kilo Explorer

I need to know if there is a way to restrict user to only select dates from future.

In vanilla HTML date input field, this can be achieved simply by using max and min attributes which only lets user to select dates from a valid range.

I understand I can check which date the user has selected with an onChange client script or UI policy, which can then clear the field and display an error message if the date selected is not in a valid range.

But I don't want users to be able to select any date from the invalid range in the first place to begin with. Is this possible in ServiceNow Date field?

 

Thanks in advance!

4 REPLIES 4

vikas shukla
Kilo Guru

Hi,

Track the path which is given in below Link and achieve your target:--

No Code date validations through (Catalog) UI Policies

Please Mark correct.

Thanks & Regards,

Vikas Shukla

donnadavis
Tera Expert

Nilesh, did you ever get an answer to this?  I am also trying to keep the user from selecting a date rather than getting an error message after the date is selected.  Thanks

NAMIJOAN
Mega Contributor

Hi,

You can refer to this doc to find out more: https://add-ons.org/how-to-add-restrict-dates-by-elemetor-forms/