Client Script OnChange - Clear field if another one changes

DesiraeSaysanav
Mega Guru

I would like to create an OnChange Client Script for the Incident form.

When the location changes I need the Configuration Item to be cleared out, this has to work before a save/update is done.

Can someone help me write this as I am not good with scripting. TIA!

1 ACCEPTED SOLUTION

kristenankeny
Tera Guru

In the script field on an onChange client script, you just need to do:



g_form.clearValue('cmdb_ci');


View solution in original post

11 REPLIES 11

kristenankeny
Tera Guru

In the script field on an onChange client script, you just need to do:



g_form.clearValue('cmdb_ci');


Thank you!!


Jaspal Singh
Mega Patron
Mega Patron

Hi Desirae,



You can try g_form.setValue('Field_name','');


That worked however now every time I Save/Update it clears the CI as well. Do you know how I can prevent this?