- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 04:21 AM - edited 09-27-2024 04:24 AM
Hi all,
We have a basic client script which we want to use to show/hide values on our Service and Security Risk Register forms, this is not working. We have tried both 'g_form.removeOption' and 'g_form.addOption' within the script itself but encounter the same issue.
We have even split the scripts out to manage each register individually, but this also did not work.
The Field Type in question is a an Integer.
Can anyone see an issue here or something we have overlooked?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 06:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2024 01:47 AM
Brad, thank you very much! That has worked.
Appreciate your time in working through this with me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2024 04:25 AM
Good to hear. You are welcome - happy to help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 05:33 AM
hi @GMoon
use following updated script and try once again
function onLoad() {
var reg = g_form.getValue('u_register');
if (reg == 'service') {
g_form.removeOption('state',20);
g_form.removeOption('state',19);
}
if (reg == 'security') {
g_form.removeOption('state',12);
g_form.removeOption('state',04);
g_form.removeOption('state',14);
g_form.removeOption('state',13);
g_form.removeOption('state',10);
g_form.removeOption('state',15);
g_form.removeOption('state',08);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 05:55 AM
Thanks for your reply, this unfortunately did not work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 07:43 AM
@GMoon Please try the following script and see if it works for you
function onLoad() {
var reg = g_form.getValue('u_register');
if (reg == 'service') {
g_form.removeOption('state', 19); // Extension Requested
g_form.removeOption('state', 20); // Treatment In Progress
} else if (reg == 'security') {
g_form.removeOption('state', 12); // Investigation
g_form.removeOption('state', 4); // Transferred
g_form.removeOption('state', 14); // Mitigation Work
g_form.removeOption('state', 13); // Limited
g_form.removeOption('state', 10); // Awaiting Closure
g_form.removeOption('state', 15); // Awaiting Approval
g_form.removeOption('state', 8); // Approved
}
}