Get catalog variable value from OnChange Variable set client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2022 01:58 AM
Hello .I need to get the value of catalog variable from the cline script in the variable set, but an empty value is returned. Maybe you know how to access variables?
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
alert(g_form.getValue("var1"));
if (g_form.getValue("var1") == 'b5dd5c831b40449ded78b04bcb07'){
alert(g_form.getValue('var2')); // return empty value
g_form.setMandatory("var3", true); // this doesn't work
}
}
Thanks in advance!
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2022 02:00 AM
Is the variable var1 in the same variable set?
If not, better create a client script at Catalog item level instead of Variable set level.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2022 02:51 AM
yes , the same variable set. This is multi row variable set. I need that when changing a variable in a multirow variable set, a mandatory field appears, which is not in the variable set

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2022 02:42 AM