- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 06:36 AM
Hi All,
I would like to write a client script that check a select box values before the task closure.
if the value does not correspond to a specific value it is necessary to stop the closure process and show a pop-up.
if the value correspond to a specific value the closure process will continue as well.
Do you have any advice?
Thanks and regards
Davide
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2022 08:09 AM
Hi Periyasamy P, helpful!
function onSubmit() {
if ((g_form.getValue('state') == 3) && (g_form.getValue('<variable name>') == '<variable value>')) {
g_form.addErrorMessage("<your message>");
return false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 07:05 AM
You can write client (Type = on submit) script to check your column value, if value is not matching your criteria.
function onSubmit() {
if (g_form.getValue("<your column name>") != "<your value>" && g_form.getValue("state")=="<state value>"){
g_form.addErrorMessage("<your error message>");
return false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2022 08:09 AM
Hi Periyasamy P, helpful!
function onSubmit() {
if ((g_form.getValue('state') == 3) && (g_form.getValue('<variable name>') == '<variable value>')) {
g_form.addErrorMessage("<your message>");
return false;
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 07:09 AM
Write onSubmit client script with validations and add return false to prevent form getting submitted. Hike like if my answer has helped you.
Regards,
Musab