How can i Clear the values in all the variable fields which is dependent on other field select box, when value is changed in that select box automatically all the values should be cleared in form..

Asish1
Tera Contributor

Hi,

Here firstly I selected change type as Normal and gave the Short Description as Test and again I changed the Change type Value to Emergency but the value of Short Description not changed so how can i give the exact condition to clear the value and also similar to all other variables present in form.. Please help me with this 

 

Thanks.

find_real_file.pngfind_real_file.png

1 ACCEPTED SOLUTION

Hitoshi Ozawa
Giga Sage
Giga Sage

Easier with Client Script.

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }

   if (oldValue != newValue) {
	   g_form.setValue('<fieldname>', ''); // have this for all the fields
   }
   
}

View solution in original post

5 REPLIES 5

Another option with client script:

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }
    if (oldValue != newValue) {
        var fieldnameList = ['u_change_short_description', 'u_change_type', 'u_change_short_description']; // list of variable names
        for (var i = 0; i < fieldnameList.length; i++) {
            g_form.clearValue(fieldnameList[i]);
        }
    }
}