- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2022 10:53 AM
Hello, i have two different variables that are "Select boxes" i want for them to have the same value as one another, When one of them is"Yes", i want them both to be "Yes" but when one of them is "no" i want them to be"no". i feel like this is easy but can seem to figure it out, any help is appreciated, thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2022 11:03 AM
Hi,
Not sure if you have shared the requirement correctly here. What I am getting from this is if One Select Box value is selected as Yes you want the other to be Yes and vice versa.
In this case you need to write two different Catalog Client script on each of these variables and on Change of one you need to se the other as Yes or No.
For example, I have written a On Change Catalog Client Script on First Select Box variable and setting the other one as Yes and No based on Selection as shown below:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'Yes'){
g_form.setValue('Variables2', 'Yes');
}else if(newValue == 'No'){
g_form.setValue('Variables2', 'No');
}
//Type appropriate comment here, and begin script below
}
Similarly write another Catalog Client script on your second variable and use the same script y just replacing the correct variable Names.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2022 11:03 AM
Hi,
Not sure if you have shared the requirement correctly here. What I am getting from this is if One Select Box value is selected as Yes you want the other to be Yes and vice versa.
In this case you need to write two different Catalog Client script on each of these variables and on Change of one you need to se the other as Yes or No.
For example, I have written a On Change Catalog Client Script on First Select Box variable and setting the other one as Yes and No based on Selection as shown below:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'Yes'){
g_form.setValue('Variables2', 'Yes');
}else if(newValue == 'No'){
g_form.setValue('Variables2', 'No');
}
//Type appropriate comment here, and begin script below
}
Similarly write another Catalog Client script on your second variable and use the same script y just replacing the correct variable Names.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2022 11:06 AM
hi shloke yes this is what is what i needed, i made two client scripts so they both can do it vice versa, thank you