Catalog client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 05:55 AM
I have one Variable in catalog item
Case 1:
If i select Yes
I need to populate the another variable
Case 2:
If I select "No"
Another variable should come.
Can some one please provide me the Catalog client script ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 08:26 AM
you can simply use newValue to compare rather than using g_form.getValue
Also if value is yes then you want to auto-populate then you should use g_form.setValue()
try this and use correct variable name
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
if (newValue == "yes") {
g_form.setValue('variableName', 'Your Text');
} else {
g_form.setDisplay('u_removed', true);
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 06:38 AM
Agree with @Ankur Bawiskar & @Anurag Tripathi , so just giving you path
Check this OOTB UI policy and you wil get idea.