- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2023 10:22 PM
Hi,
In onChange client script i can't able to get the error message please help me out the reason.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2023 10:32 PM
HI @kranthi2 ,
Please use " g_form.addErrorMessage('message goes here'); " not g_form.showErrorBox('Invalid Date', 'Future dates are not allowed.');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2023 10:32 PM
Hi,
This kind of date comparison will not work, because it's different in the formatting.
the "new Date()" will return something like this: "Mon Dec 11 2023 07:28:47 GMT+0100..."
while the newValue probably will return something like: "2023-01-31 Tue 04:33:54"
I would recommend sending the existing date (newValue) to a scriptInclude and do the comparison serverside, then return true/false back from the function, and use the returnvalue from the function in your clientscript.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2023 10:32 PM
HI @kranthi2 ,
Please use " g_form.addErrorMessage('message goes here'); " not g_form.showErrorBox('Invalid Date', 'Future dates are not allowed.');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2023 10:35 PM
Hi,
if it is simple validation then you can use UI Policy:
Please check below Article:
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2023 10:38 PM - edited 12-10-2023 10:42 PM
Hi @kranthi2 You can achieve this with UI Policy like below
Alternatively you can use the client script below
Harish