Validating Date field on client script

umaaggarwal
Giga Guru
Giga Guru

I have a date field on incident form, i want to validate that that date I enter there should be after 7 days from today, How do I achieve this ?

 

Thanks!

 

1 ACCEPTED SOLUTION

asifnoor
Kilo Patron

Hi,

To validate date fields through client script, refer to this article 

Kindly mark the comment as a correct answer and helpful if it helps to solve your problem.

Regards,
Asif
2020 ServiceNow Community MVP

View solution in original post

7 REPLIES 7

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Question: why do you mention Client Script?

You could do this with UI Policy like Abhishek already mentioned. There's really no need to do this with Client Script.
Have a look at that article Abhishek mentioned, is a really nice one 🙂

Kind regards,
Mark

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hi Mark, Thank you very much for the article. It was really helpful. But I have a requirement where it should not count the weekends. 

 

Eg - If today is Wednesday, the user should not be able to select Saturday or Sunday. Any assistance on this would be really helpful.

asifnoor
Kilo Patron

Hi,

To validate date fields through client script, refer to this article 

Kindly mark the comment as a correct answer and helpful if it helps to solve your problem.

Regards,
Asif
2020 ServiceNow Community MVP