- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2021 08:43 AM
I'm needing a Catalog Client Script that will automatically place a checkmark in a checkbox variable B when checkbox variable A is check marked.
This probably sounds relatively easy but I am not a heavy coder and not sure where to start.
Thanks,
Brandon
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2021 09:54 AM
You will need to add '' around the true since this is not a boolean.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'true'){
g_form.setValue('checkBoxB', 'true');
}
}
Try this and see what you get
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2021 08:46 AM
Could probably do an onChange client script tied to the first checkbox. Then test if the first checkbox is true. Something like the below should work.
if (g_form.getValue('fieldName') == true){
g_form.setValue('secondField',true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2021 08:54 AM
You can do it like this:
Script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == true){
g_form.setValue('checkBoxB', true);
}
}
MVP 2025 ✨
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2021 09:11 AM
Thanks but this did not work. Once I placed a checkmark in the checkbox variable A, checkbox variable B did not automatically get a checkmark.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2021 09:54 AM
You will need to add '' around the true since this is not a boolean.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'true'){
g_form.setValue('checkBoxB', 'true');
}
}
Try this and see what you get