When i am writing a client script on NOne option to clear the values its not working.

sushma9
Tera Contributor

I have written On change client script when None Is selected to clear the options but its not working .please find the script below.

function onChange(control, oldValue, newValue, isLoading) {

if (newValue == '  ') {

g_form.clearOptions('which_state_is_impacted');
}

}

10 REPLIES 10

This will work.

Tested in my PDI.

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

    if (newValue == '') {
        g_form.clearOptions('which_state_is_impacted');
    }

}
Thanks,
Murthy

 Its not working 

Share your entire script with screenshots

Thanks,
Murthy

Please find the screen shot below.

I don't see any issue in your code.

Please cross-check the variable names which you given.

Thanks,
Murthy