g_form.clearValue() does not work in the catalog client script

Kalyani35
Tera Guru

HI experts,

Using a onchange client script(onchange of variable month_of_overtime) I want to clear the selected value in the selectbox type of a variable in a variable set based on the response received from the Glide Ajax call. Everything works fine as expected but, as soon as I add the statement to clear the selectbox variable it throws an error on the form.

Please look at the screens shot below.

Screenshot of error:

 

If I remove the clearValue statement the error message does not appear.  What could be the reason for this?

Note: the Script include is returning correct value so nothing is wrong there.

 

Thanks

 

13 REPLIES 13

Murthy Ch
Giga Sage

Hi Kalyani,

Interchange both the lines 17,18 and try.

OR


g_form.setValue("month_of_overtime","");

 

Thanks,

Murthy

Thanks,
Murthy

Hi Murthi,

I have tried that already. It does not work.

Kalyani Jangam1
Mega Sage
Mega Sage

Hi, try clearoption as it is select box

    g_form.clearOptions();

Please check and let me know if still facing the issue.

Hi Kalyani,

clearOptions would clearall the available options. So would not work,