Updating checkbox values on user input

Updating checkbox values on user input

Hi Zoho,

I have a checkbox field with 5 items in my form.
I'd like to add an "Import all" option. I've added a "Import all" item to the checkbox list,
and added the following script to the "checkbox field -> on user input" on the form script:

if checkbox_field.contains("Import All")=true
{
checkbox_field.add("element01");
checkbox_field.add("element02");
      checkbox_field.add("element03");
checkbox_field.add("element04");
      checkbox_field.add("element05");
}
if checkbox_field.contains("Import All")=false
{
checkbox_field.removeElement("element01");
checkbox_field.removeElement("element02");
      checkbox_field.removeElement("element03");
checkbox_field.removeElement("element04");
      checkbox_field.removeElement("element05");
}


It did not carry out the desired behavior.


How can I approach this?

Thanks!
Ravid