1 Reply Latest reply on Apr 9, 2013 1:02 AM by darje6666

    3 checkboxes but only 2 at a time

    darje6666

      Hi, so I have a form where the user needs to select 2 out of 3 possible checkbox choices. What I want it to do if you have selected for instance 1st and 2nd checkbox and then you change your mind and want the 3rd instead of 2nd I want it to delete the last selected checkbox and select the 3rd one. Whats the javacript for this? thanks

        • 1. Re: 3 checkboxes but only 2 at a time
          darje6666 Level 1

          Ok I've found an answear if anyone wants to know.

          Put this Formcalc inside layout:ready event for the subform these checkboxes are in. So no code is neccesarry inside the checkboxes.

           

          Heres the code for the layout:ready part

           

          if (Sum(subform.checkbox2, subform.checkbox3) ge 2) then

              checkbox1.access = "readOnly"

          else

            checkbox1.access = "open"

          endif

           

          if (Sum(subform.checkbox1, subform.checkbox3) ge 2) then

              checkbox2.access = "readOnly"

          else

            checkbox2.access = "open"

          endif

           

          if (Sum(subform.checkbox1, subform.checkbox2) ge 2) then

              checkbox3.access = "readOnly"

          else

            checkbox3.access = "open"

          endif