7 Replies Latest reply on Sep 4, 2009 1:25 PM by pickler

    CheckBox Sets

    pickler

      Title

      CheckBox Sets

      Post

      Is there a method to make a checkbox set that outputs different data. eg  Checkbox set has values from a value list that are "red" "blue" and "green".  When the user checks off "red", the output to the field is "red colour selected"

       

      Thanks in advance 

        • 1. Re: CheckBox Sets
          ninja
            

          Howdy pickler,

           

          You could have a second field which is calculated from the first:

           

          Case (Checkbox="red" ; "red colour selected";

          checkbox="blue" ; "blue colour selected";

          etc.)

           

          It's more of an conditional input rather than an output, but it ends up at the same place.

           

          Edit: added "" marks.

          • 2. Re: CheckBox Sets
            philmodjunk
              

            You can use a calculation field that displays different text messages depending  on what item(s) is/are selected in a check box field. Is that what you want?

             

            First key question: What do you want to see if both "Red" and "Blue" are selected? If you only want the user to select a single value, use radio buttons instead.

             

            If only single values are allowed:

             

            YourField & " colour selected"

             

            will produce the results you describe.

             

            Multiple values displayed in a multiline field:

             

            Substitute ( yourfield ; "¶" ; " colour is selected¶") & " colour is selected"

             

            Note:: ¶ is the return character that separates each selected value when the user clicks more than one checkbox.

            • 3. Re: CheckBox Sets
              pickler
                 Thanks for the help.  I have set up a field that now inputs the data from the checkbox, however i cant seem to finalize it.  Here is my predicament.  in my checkbox I have 5 choices. They are attic, stack, light, cable and wall.  When the user selects one or more options, the new field should read "Recommend sealing attic, stack and wall".  I hope this is clearer.  THX
              • 4. Re: CheckBox Sets
                philmodjunk
                  

                As always, the devil is in the details.

                 

                "Recommend sealing " & Substitute ( yourfield ; "¶" ; ",")

                 

                Should produce: Recommend sealing attic, stack, wall

                 

                If you can live without the "and" in place of the last comma life is simpler. Otherwise, I think you'll need either a script or a custom function to replace that last comma with "and".

                • 5. Re: CheckBox Sets
                  comment_1
                    

                  Try:

                   

                   

                  Let ( [ pos = Position (  CheckBox ; ¶ ; Length ( CheckBox ) ; - 1 ) ; rpl = Case ( pos ; Replace ( CheckBox ; pos ; 1 ; " and " ) ; CheckBox ) ] ; "Recommend sealing " & Substitute ( rpl ; ¶ ; ", " ) & "." )

                   

                   

                   

                  • 6. Re: CheckBox Sets
                    philmodjunk
                      

                    Kudos to Comment for teaching me a new trick!

                     

                    Never knew that a -1 would search the string in reverse. (I should have, I can find it in the help file all the way back in FMP 5.5)

                    • 7. Re: CheckBox Sets
                      pickler
                        

                      Works great!!! Thanks for your input and time

                       

                      David