- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2024 08:00 AM
hello All,
Appreciate you response and help.
I have a client script on a incident form to limit the number of users to be added to additional assignee to only 2.
The script written gives the needed error message, when more than 2 users are added, but continues to add the users and lets us submit the incident form.
I need to restrict the user from submitting form and not let the user add more than 2 users.
Here is the client script. Please let me know where is it wrong.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2024 08:10 AM
Hi @Shree Nag
You can try the below script and it is working for me in PDI. In place of alert change as per your need.
function onSubmit() {
//Type appropriate comment here, and begin script below
var values = g_form.getValue('additional_assignee_list').toString().split(',');
if (values.length > 2) {
alert('You cannot add more than 2 assignees.');
return false;
}
else {
return true;
}
}
Thanks and Regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2024 08:10 AM
Hi @Shree Nag
You can try the below script and it is working for me in PDI. In place of alert change as per your need.
function onSubmit() {
//Type appropriate comment here, and begin script below
var values = g_form.getValue('additional_assignee_list').toString().split(',');
if (values.length > 2) {
alert('You cannot add more than 2 assignees.');
return false;
}
else {
return true;
}
}
Thanks and Regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2024 08:31 AM
Thank you. That worked !