5 Replies Latest reply on Jun 8, 2015 12:41 AM by raybaudi

    Checkbox,

    priyankjayna

      Title

      Checkbox,

      Post

      HI i have numerous fields with checkboxes like

      "caries", "pain", "cleaning", "mobile teeth", "missing teeth" etc.

      also a field "others" where text can be filled

      ....

       i have a text field by name "chief complaint"....

       

      now if i check "Caries" then in the "chief complaint" field it should automatically write caries..... 

      same way when i check the box of say "caries" ,"pain" and "cleaning" i want in the "chief complaint" field it should automatically write "caries, pain, cleaning"   ...

      also if i say check box of "caries" and type something in "others" say checkup then in the "chief complaint" field it should automatically write "caries, checkup"

      kindly let me know the script for this.

       

       

        • 1. Re: Checkbox,
          raybaudi

          Add this calculation in the auto-enter option of calculated value for the field  "chief complaint":

          Substitute ( YourCheckBoxField ; ¶ ; ", " )

          Also uncheck the box: "Do not replace existing value of field( if any )"

          • 2. Re: Checkbox,
            priyankjayna

            ray,

            it did not work the way i want… it just showed yes in front of "chief complaint" and not YourCheckBoxField, moreover incase i check two fields it still showed no change.

             

            • 3. Re: Checkbox,
              raybaudi

              "moreover incase i check two fields it still showed no change."

              A field, formatted as checkbox, still is a single field. You could select more than one box and the result is a list of elements.
              So, creating a new text field ( or a calculated field ) with the given formula, you'll see the result you wish.

               

              • 4. Re: Checkbox,
                priyankjayna

                ray am sorry kindly explain me a bit more...

                i have done it as follows

                1) Made text field by the names 

                checkup 

                caries

                pain

                mobile teeth

                cleaning

                ......

                on the form have defined them as checkbox style with values as yes / no

                2) Now  i made a field 

                Chief compliant in which for calculation auto enter have written

                Substitute ( Caries; ¶ ; ", " ) +

                Substitute ( checkup ; ¶ ; ", " ) +

                Substitute ( pain ; ¶ ; ", " ) +

                Substitute ( mobileteeth ; ¶ ; ", " ) +

                Substitute ( cleaning ; ¶ ; ", " )

                 

                in which have double clicked on the field to get checkup, caries, pain etc

                 

                3) now what i want is when i click on press checkup , pain, caries

                it should autoenter "checkup, pain, caries" in the chief complaint field

                 

                 

                kinldy let me know where am i going wrong

                 

                • 5. Re: Checkbox,
                  raybaudi

                  If you have so many field, the calculation must be:

                  Substitute (
                  List (
                  If ( caries ; "caries" ) ;
                  If ( checkup ; "checkup" ) ;
                  If ( pain ; "pain" ) ;
                  If ( mobileteeth ; "mobileteeth" ) ;
                  If ( cleaning ; "cleaning" )
                  ) ;
                  ¶ ; ", "
                  )