- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2023 04:21 AM
Only allow the current day and the following day to be selected. All other days should not be allowed.
Date variable should be allowed only select either today or tomorrow.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2023 02:45 AM
Glad to know my response helped.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2023 05:03 AM
Hi @SivaKumar123 ,
Please refer the link below
https://www.servicenow.com/community/developer-articles/date-validations-client-scripts/ta-p/2298860
Please mark this response as correct or helpful if it assisted you with your question.
Regards,
Harshal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2023 06:53 AM
- Use the 'min' and 'max' attributes to limit the date range of the date picker
- Set the 'min' attribute to the current date and the 'max' attribute to the following day
- Make sure the 'min' and 'max' attributes are formatted correctly in the 'yyyy-mm-dd' format
- Use the 'read-only' attribute to prevent users from manually entering dates outside of the specified range
For asking ServiceNow-related questions try this :
For a good and optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - https://nowgpt.ai/
For the ServiceNow Certified System Administrator exams try this :
https://www.udemy.com/course/servicenow-csa-admin-certification-exam-2023/?couponCode=NOW-DEVELOPER
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2023 07:19 AM
You can simply do it with UI policy with no code
Sample : ( modify the conditions accordingly)
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2023 02:32 AM - edited ‎05-19-2023 02:33 AM
Hi Voona,
Its working after change the filter condition
Start date before today OR start date after tomorrow condition.
and
function Oncondition()
{
Alert('Date variable should be allowed only select either today or tomorrow');
g_form.clearValue('start_date');
}
Thanks everyone for helping me