- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 11:15 PM
Hello,
Want to know how to create client script if Active Field is false then, populate error/info message that user already made inactive and not able to submit the request. Thank you in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 11:18 PM - edited 11-08-2023 11:19 PM
Hi @Community Alums ,
Instead of creating client script you can put a filter of Active is true in Requested For field in your form which will only display active users. You can go that requested for variable & under Type specification u can add 1 filter condition.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 11:25 PM
@Community Alums
Attaching screenshot for your reference.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 11:28 PM
Hi @Community Alums ,
Use below script
function onSubmit() {
var activefield = g_form.getValue('active');
if (activefield === 'false') {
g_form.addErrorMessage("You cannot submit the request for an inactive item.");
return false;
}
return true;
}
Please mark it as solution proposed and helpful if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 11:18 PM - edited 11-08-2023 11:19 PM
Hi @Community Alums ,
Instead of creating client script you can put a filter of Active is true in Requested For field in your form which will only display active users. You can go that requested for variable & under Type specification u can add 1 filter condition.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 11:25 PM
@Community Alums
Attaching screenshot for your reference.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 11:28 PM
Hi @Community Alums ,
Use below script
function onSubmit() {
var activefield = g_form.getValue('active');
if (activefield === 'false') {
g_form.addErrorMessage("You cannot submit the request for an inactive item.");
return false;
}
return true;
}
Please mark it as solution proposed and helpful if it serves your purpose.
Thanks,
Anand