- 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
09-27-2024 04:48 AM
Hi @GMoon
I checked your screenshot "Client script 2", it looks like the logic was written outside the onLoad function.
remove the curly bracket in line number 4 and add curly brace after 20
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 04:57 AM
Hi @GMoon,
You have written the logic outside the onLoad() method. Please do check the reference image
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 05:03 AM
Hi @GMoon,
The code you have written outside of the onLoad() method. Please do check the reference image attached below.
Thanks,
Anusha Bonthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 05:21 AM
Your second if statement is nested inside the first, which logically doesn't make sense as the second will never run, and since both are outside of the onLoad function, the first will also never run. Move the } from line 4 to line 8. If it's still not working as expected, add an alert to line 4 to confirm the value used in the if statements:
alert('reg value = ' + reg);