- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2021 05:06 PM
Hi i need to hide/show one option on the multiple choice variable based on other field (the other field is department, so when the department field has Field Service in it the option should hide otherwise show other times), Below is the CS, but it does not hide/show the Keyboard & Mouse option.
variable: department, where the department is Field Service (need contains Field Service)
multi choice variable: type
option value and display name: accessories - Keyboard & Mouse
script onchange on department:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
g_form.removeOption('type', 'accessories ', 'Keyboard & Mouse');
return;
}
if (g_form.getValue('department').indexOf('Field Service') > -1) {
g_form.removeOption('type', 'accessories ', 'Keyboard & Mouse');
}else {
g_form.addOption('type', 'accessories ', 'Keyboard & Mouse');
}
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2021 10:31 PM
I have found the answer: addOption, removeOption does not work on Multiple choice type variable, i have changed it to Select Box type and it works fine now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2023 02:56 AM
Hi,
I have the same reqirement, however I can't change the field type. Is there any way to make it work for multiple choie field?