Automatically select checkbox if other checkbox is selected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2019 01:29 AM
Hi there,
I have some difficulties to set up one of the catalog item and I would like to ask for help if possible.
I've created the item with multiple checkbox A, B, C, D, E, F, G
I need to configure this item so when C is selected, checkbox B is automatically selected too or when G is selected, checkbox B and C are auto selected and no editable.
Each of the checkbox have variables and I tried to create a script to meet my expectation but no luck so far.
Thanks for your time.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2019 04:52 AM
I would accomplish this with a Catalog UI Policy. First with the condition builder, state if FarmMapping variable is equal to true and then set the BingMaps var to true. You could also then reverse the checking if the FarmMapping box is unchecked.
Below is a task I had to preform with a "business card" checkbox that set a title field to mandatory when it was checked. I built my condition here, and then set the other field state via script in the "script" tab.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2019 07:40 PM
Hello
It can be done using Catalog Client Script with OnChange type. you can use following script for automatic selection of your checkbox.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == "true")
{
//g_form.addInfoMessage("checked A");
g_form.setValue('b', "true");
}
if (newValue == "false")
{
if (g_form.getValue("A") == "false" && g_form.getValue("C") == "false" && g_form.getValue("D") == "false") {
g_form.setValue('B', "false");
}
}
IF This is helpful to you Then mark It as correct or helpful.