How to hide choices from choice list using client script onchange

swathigangadhar
Tera Expert

How to hide choices from choice list using client script onchange, i want to hide few choices in subcategories when category is changed, i tried using g_form.removeOption('subcategory', '7'); but no luck, how to solve this?

16 REPLIES 16

If your using subcategory as dependent field to category,you have to uncheck that. that;s the reason it is not removing when I tested in personal dev. i unchecked dependent field on subcategory and this code is wrkg fine



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


    if (isLoading || newValue === '') {


          return;


    }


var getCategory = g_form.getValue('category');


  alert(getCategory);


  if(getCategory=='software')


  {


  alert('insde');


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


  }


Regards
Harish

I want both functionalities.


I have same requirement with you, have you resolved your problem?


If you solved your problem, could you share with your solution?


Hi Swathi,



Did you get the solution? If yes, can you please post it here.



Regards,


Dedeepya