- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2020 01:32 AM
Hello!
I have 2 variables X & Y.
Variable X is a Select Box with values A & B
Variable Y is a Select Box with values 1, 2, 3, 4, 5, 6
I want to achieve are:
When X = A, Y should only display 1, 2, 3
When X = B, Y should only display 4, 5, 6
How to do this?
Should I create 2 catalog client scripts for X = A and X = B?
Please help!
Thank you!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2020 02:08 AM
Hey,
I did same requirement on my instance and it is working right
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'a'){
g_form.addOption('variable_y',1,1);
g_form.addOption('variable_y',2,2);
g_form.addOption('variable_y',3,3);
g_form.removeOption('variable_y',4,4);
g_form.removeOption('variable_y',5,5);
g_form.removeOption('variable_y',6,6);
}
else if(newValue == 'b'){
g_form.addOption('variable_y',4,4);
g_form.addOption('variable_y',5,5);
g_form.addOption('variable_y',6,6);
g_form.removeOption('variable_y',1,1);
g_form.removeOption('variable_y',2,2);
g_form.removeOption('variable_y',3,3);
}
//Type appropriate comment here, and begin script below
}
Thanks,
Shrutika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2025 10:15 PM
I have similar requirement. So without using addOption and removeOption can we achieve in another way. ?
g_form.addOption
g_form.removeOption

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2020 02:08 AM
Hey,
I did same requirement on my instance and it is working right
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'a'){
g_form.addOption('variable_y',1,1);
g_form.addOption('variable_y',2,2);
g_form.addOption('variable_y',3,3);
g_form.removeOption('variable_y',4,4);
g_form.removeOption('variable_y',5,5);
g_form.removeOption('variable_y',6,6);
}
else if(newValue == 'b'){
g_form.addOption('variable_y',4,4);
g_form.addOption('variable_y',5,5);
g_form.addOption('variable_y',6,6);
g_form.removeOption('variable_y',1,1);
g_form.removeOption('variable_y',2,2);
g_form.removeOption('variable_y',3,3);
}
//Type appropriate comment here, and begin script below
}
Thanks,
Shrutika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2020 04:02 AM
hey,
Any updates?
If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
Thanks,
Shrutika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2020 07:34 AM
Thank you for the helpful solution Shrutika Surwade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2025 10:13 PM
without using addOption and removeOption can we achieve in another way. ?
g_form.addOption
g_form.removeOption