4 Replies Latest reply on Feb 11, 2014 12:10 AM by UchihaItachi

    Link checkboxes to a dropdown list



      Link checkboxes to a dropdown list



           I'm starting with FileMaker and I found enough information to build some basic layouts. Now I'm trying to link a dropdown list to a set of checkboxes. My goal is to be able to choose a value in the list and then check some checkboxes that will stay linked to the value in the dropdown list. When I'll change the value in the list, I want the checkboxes to follow it, so I'll be able to know what is included (by seeing the checkboxes) in every value in the list.

           Thank you for the help

        • 1. Re: Link checkboxes to a dropdown list

               Do you mean that if you select a specific value in a dropdown list, a specific subset of check box values in a second field will be automatically selected?

               The OnObjectSave trigger on the drop down list could be used to perform a script that sets specific values in the checkbox formatted field. Or a table of related records could be used to create the illusion of check boxes with no scripting required.

          • 2. Re: Link checkboxes to a dropdown list

                 Yes, I want to link the set of checkboxes to a dropdown list so that if I select for example the value "A" in the list, the checkboxes "aa" "cc" and "dd" show checked. And if I uncheck "cc", I want the value in the list to keep only "aa" and "dd" in memory. So every now and then, I'll be able to check and uncheck checkboxes and they will keep linked to their "parent value" in the dropdown list. Is it possible to have this kind of "database within the database"?


            • 3. Re: Link checkboxes to a dropdown list

                   This is definitely possible and there is more than one way to do it. The simplest approach "hardwires" the values to the script and requires modifying the script to change what values are selected. A better approach, what I am about to describe, copies the values from a related table. This approach allows you to update what values get selected without having to update the script.

                   And you can set this up so that selecting a value in the drop down list clears existing values selected in the check box field or it can add the associated values to those already selected...

                   Set up a related table of check box values:

                   MainTable::DropDownListFIeld = CheckboxValues::Category

                   Now a script can be used to add the associated values from CheckBoxValues to your check box field in MainTable to those already selected or an auto-enter calculation can simply replace all currently selected values with the values from CheckboxValues.

                   The script, performed by an OnObjectSave trigger on the drop down list:

                   Set Field [MainTable::CheckboxField ; List ( MainTable::CheckBoxField ; List ( CheckboxValues::CheckBoxValue ) ) ]

                   The auto-enter calculation that can be specified for field options for CheckBoxField:

                   List ( CheckBoxValues::CheckBoxValue )

                   and then you clear the "do not replace existing values..." checkbox

              • 4. Re: Link checkboxes to a dropdown list

                     I also encountered the similar curiosity on the problem since I used another UI Dropdown List. The answer is explicit.