Issue with Client Script

GMoon
Tera Guru

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!

1 ACCEPTED SOLUTION

if (reg == 'service') {

...

if (reg == 'security') {

View solution in original post

19 REPLIES 19

Hi Brad,

Thanks for your response. I moved the brackets as suggested and I see some of the values are removed from both registers, as opposed to one or the other (see attached). I added the alert as suggested too and it pops up with the following (attached) blank across both forms, so this appears to be our issue?

I would think if reg is empty, neither condition would be satisfied, so no code would execute, but there may be something else going on, so one thing at a time.  Have you confirmed that 'u_register' (case-sensitive) is the correct name of the field you want to test the value of, and that it is present on the form, and contains a value when the form is loaded?

Thanks Brad.
I added a field on the forms to differentiate before posting, as I thought I had solved the issue initially. By adding them back on, the pop up does show values as expected, for each respective form.

Great - so everything is working now?

No, the values have reduced but are showing the same across both forms. To clarify, I meant that I now have values showing on the pop up alert.