Hide an option from drop down
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 12:18 PM
Hello,
I have two drop down fields. Depending on what is selected from the first drop down i would like to hide an option from the 2nd drop down field. How can I do that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 12:35 PM
Hi @Jen11
Where, for table or catalog item form?
field type?
and how are you adding choices? from script or added manually?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 12:59 PM
catalog item....added manually
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 05:37 AM
Hi @Jen11
For 2nd drop down in which you want to remove, don't add choices manually.
Create an onchange client script on 1st dropdown variable and try this script with your fields and choice names
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
g_form.addOption('choice_2', 'optionA', 'OptionA');
g_form.addOption('choice_2', 'optionB', 'OptionB');
g_form.addOption('choice_2', 'optionC', 'OptionC');
return;
}
g_form.addOption('choice_2', 'optionA', 'OptionA');
g_form.addOption('choice_2', 'optionB', 'OptionB');
g_form.addOption('choice_2', 'optionC', 'OptionC');
if (newValue == 'calgary') {
g_form.removeOption('choice_2', 'optionB');
} else if (newValue == 'edmonton') {
g_form.removeOption('choice_2', 'optionA');
}
}