g_form.addOption triggering onChange Client Script

kani1
Kilo Contributor

i have an onChange client script to do some stuff when value on the formfield is changed. Since this field is populated dynamically, every time addOption is executed, Onchange client script gets executed as well.

So, When I change a value on the form, it is understandable to call onChange. Why is it calling OnChange event even when value is not changed, just that values are populated. Anyone has come across this issue?

6 REPLIES 6

Srinivas Balusu
Kilo Guru

In your client script, try removing 'isLoading' and other stuff


find_real_file.png


Srinivas Balusu
Kilo Guru

Check this as well. Will guide you in removing the un-related ones.



find_real_file.png


I have 2 levels of dependency in my client scripts.




1) When SVC Category is changed, populate SVC Tier1


2) When SVC Tier 1 is changed, populate SVCTier2 and Cause category


3) When Cause category is changed, populate cause



Issue is that when I add options to populate, old and newValue are same. In such case, I dont want to do anything.



at the same time, if I user is playing on the UI by changing values and it they go back to original value, in such case old and new Value will be same and I need to populate dependent fields accordingly. I am not finding a way to differentiate these 2 scenarios. One is, when addOption with oldValue and newValue same; Secondly, User is going back to original value from the form.


Can you post screen shot of this? Its little confusing