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

Hi Usha,



It should work. can you paste your updated script?


let me explain what i understood till now.



you have two field "cat" and "sub cat".


cat have two values "defect","unknown"


sub cat have " Known Issue ","Unknown Risk Acceptance", "Risk Rejected"



now you want to completely hide the "risk rejected". it will not depend on category. am i correct?



for rest of other values. you want to make dependency.


when ever you will select defect in category field then know issue should be visible and unknown risk acceptance should not b visible.


and if you select unknown then Unknown Risk Acceptance should be visible and known issue should not be visible.



if this is your requirement then above code should solve it.


if not then please add your inputs




Thanks,


Harshvardhan


vivian08081
Giga Expert

Have you solved your problem? If yes could you share the solution with me? I have the same requirement with you


Hi Wei,



can you please explain me where exactly have you stuck? the code i had post worked fine at my end.


I have the same requirement with Usha. I used your solution try to solve the problem, but it doesn't work.



For dependent field, removeOption('subcategory','value') doesn't work in client script. Any other solutions?


can you paste your script?