- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2022 12:59 AM
please help me to display the select box values based on another select box in a catalog item form.
For example I want to write catalog client script of type onchange because when I select Neurologist in select box so available doctors should be those only whose specialization is Neurologist.
Solved! Go to Solution.
- Labels:
-
Studio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2022 01:09 AM
Hi Priya,
You would require onchange client script on the select item variable; sample script below, just adjust or tweat as per your values:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
g_form.clearOptions('request_type');
if(newValue == 'Card Swipe Unit'){
g_form.addOption('request_type', choicevalue, choiceLabel);
g_form.addOption('request_type', choicevalue, choiceLabel);
}
}
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2022 01:05 AM
Hi,
Both the fields are choice type?
Regards,
Sourabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2022 01:07 AM
Yes both are choice type

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2022 01:13 AM
Hi,
then you simply specify the dependent value to have only those values which are dependent on other choice field selection.
Ex. For Specialization field the choice is "Dermatology" (label) and value as "dermat"
then for Select doctor field (you need to show doc1 and doc2) then you need to select the dependent field value as "dermat".
Note : You can check the OOB functionality on incident table for Category & Sub category field.
Suppose if category is "Network" then the below sub category will appear only.
Mark this as Helpful/Correct, if Applicable.
Regards,
Sourabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2022 01:09 AM
Hi Priya,
You would require onchange client script on the select item variable; sample script below, just adjust or tweat as per your values:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
g_form.clearOptions('request_type');
if(newValue == 'Card Swipe Unit'){
g_form.addOption('request_type', choicevalue, choiceLabel);
g_form.addOption('request_type', choicevalue, choiceLabel);
}
}
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep