Disable/ remove choice list options on the form

ushakarthya
Kilo Contributor

Hi can anyone help me out on how can we either disable/removing the choice list options on the form.

I tried couple of things which did not work fully..

Scenario: I have a cat(1,2) and subcat(1- subcat1, 2- subcat2, subcat3) where subcat values are dependent on cat values. I need one of my subcat value(subcat3) to be removed/disabled based on cat value(2). I have used removeOption and disableOption both seems to be working on load.. but when I change the values and reset again it shows the entire list.

Can you please share your valuable suggestions.

Thank You.

19 REPLIES 19

find_real_file.png


try to store the field value in one variable.


var abc=g_form.getValue('<field name>');


if(abc=='software')


{


g_form.removeOption('subcategory','email');


}


thank you for your time.



The scripts you paste before doesn't work in client script.


Hi Wei,



Did you get a chance to check my response here: How to hide values of subcategory


before i tried at my end and it worked. right now you are doing it on category and sub category field. make sure before implementing it through scrip please check "dependent field" has not set on category. else it will be conflict.



find_real_file.png