Unchecked an option in a checkbox when another option is checked

Unchecked an option in a checkbox when another option is checked

Hi, in a Creator form, I have around twenty checkbox fields, named for example "cb1", "cb2", "cb3", etc...

Each of these fields have two options: Done and N/A.

I would like to be able to for each field, if I check "Done", "N/A" is unchecked, and if I check "N/A", "Done" is unchecked. And if I uncheck both, it remains unchecked.

I don't want to repeat the code for all 20 fields, I assume there is a solution to get all the fields, or list them, and then loop, but everything I try doesn't work.

If you have an example to offer me, that would help me a lot, thank you.

Exemple :
  1. checkBoxFields = {"cb1", "cb2", "cb3", "cb4", "cb5"};

  2. for each cbField in checkBoxFields
  3. {
  4.     fieldValue = cbField.values();
  5. info fieldValue ;

  6.     if (fieldValue.contains("Fait"))
  7.     {
  8.         fieldValue.remove("N/A");
  9.         input.set(cbField, fieldValue);
  10.     }
  11.     else if (fieldValue.contains("N/A"))
  12.     {
  13.         // Décocher "Fait"
  14.         fieldValue.remove("Fait");
  15.         input.set(cbField, fieldValue);
  16.     }
  17. }

      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ



                                ご検討中の方