1 Reply Latest reply on Feb 20, 2015 4:15 PM by philmodjunk

    Need help with Checkbox script

    danlee

      Title

      Need help with Checkbox script

      Post

      I need to create 2 checkbox.  One for Weight Loss and another for Weight Gain.  If the user checks Weight Loss that calculation would be used and if the user check Weight Gain that calculation would be used.  

      The calculation for Weight Loss is:

      Case ( not IsEmpty ( ActivityLevelPossibleDelete ) ; Max ( Case ( ActivityLevelPossibleDelete = "Sedentary" ;(1.2 * BMRCalculator) - 500;
      ActivityLevelPossibleDelete = "Lightly Active (1-3 days/week)";(1.375 * BMRCalculator) - 500;
      ActivityLevelPossibleDelete = "Moderate (3-5 days/week)" ;(1.55 * BMRCalculator) - 500;
      ActivityLevelPossibleDelete = "Very Active (6-7 days a week)" ;(1.725 * BMRCalculator)-500) ; 1200 ) )

      and the calculation for Weight Gain is:

      Case ( not IsEmpty ( ActivityLevelPossibleDelete ) ; Max ( Case ( ActivityLevelPossibleDelete = "Sedentary" ;(1.2 * BMRCalculator) + 500;
      ActivityLevelPossibleDelete = "Lightly Active (1-3 days/week)";(1.375 * BMRCalculator) + 500;
      ActivityLevelPossibleDelete = "Moderate (3-5 days/week)" ;(1.55 * BMRCalculator) + 500;
      ActivityLevelPossibleDelete = "Very Active (6-7 days a week)" ;(1.725 * BMRCalculator) + 500) ; 1200 ) )

      I am not sure how to go about setting this up.  Thank you for any help on this!

        • 1. Re: Need help with Checkbox script
          philmodjunk

          Will you use one field with two check boxes or two fields with one check box each?

          What if they select both check boxes? Say be mistake?

          If the user is only supposed to select one of the two options, a radio button format on a single field would be the better option.

          You can check the value of a single check box field or a radio button formatted field in a calculation just like you would a field formatted like an edit box. Fields formatted to permit selecting multiple values in the same field such as a group of check boxes requires a different approach.