How to make choices in "choice list variable" visible based on the value of another variable field' in the same catalog item?

feroz4051
Mega Expert

How to make choices in "choice list variable" visible based on the value of another variable field' in the same catalog item?

1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

HI Feroz,



you can use onchange client script wherein you can see the value selevted in field A and depending on that you can add/remove options in field B(choice List Variable)



Use these functions for the same



g_form.addOption('<Variable Name>','<value>','<display value>');   // To add options to the dropdown


g_form.clearOptions('<variable name>');   //To remove all values from the dropdown


g_form.removeOption('<Variable Name>', '<value>');   // To Remove 1 option from the dropdown


g_form.setValue('<Variable Name>','<value>');   // To select by default any one of the options.




Hope this helps.


-Anurag

View solution in original post

7 REPLIES 7

Hello,

I had similar request for choice manipulation, but this work only in "English" not a complete solution if its going to be visible for users whose language is not English (in terms of translation it will not work)

Any other OOTB way to achieve this and will work in any language?

 

Thanks

Aniket

Hi Anurag,

 I have a requirement that I have created 2 variables having 6 choices in varA and 30 choices in varB. I need to populate only specific choice in varB if we select one choice in varA. we can say like 1:5