13 Replies Latest reply on Feb 20, 2017 10:26 AM by philmodjunk

    showing 'other' value in value list checkbox

    cwcrogan

      I have a field set as a checkbox using a value list. I'd like to enable the user to add other value(s) (usually not more than one). But, firstly, I don't want to allow the popup that enables an enduser to add a value to the return delimited list of the field - I'm more than positive that this will lead to all kinds of problems. I'd also like to display the additional value(s) (even if an additional field is needed to do so). I have no idea how to go about this however. Any help is greatly appreciated.

        • 1. Re: showing 'other' value in value list checkbox
          siplus

          You would like, but then you wouldn't.

           

          Have an email button that opens up a dialog, asking "suggest new value" and a global in which he can write the value. On ok button in the dialog, script a mail sent to you with the suggested value and you will decide whether to add it or not.

          • 2. Re: showing 'other' value in value list checkbox
            philmodjunk

            "other" and "edit" are two different value list options. Allowing "other" will not allow them to edit the value list. You may know that, but I'm making sure.

             

            To show the "other" value that they've entered is a bit tricky. You'd need a calculation field that returns all values not in the field's defined value list to place next to the check box formatted field. There are custom functions you can find on a site such as the Brian Dunning site that return the items that arent' in a list and you can use the ValueListItems function to return the items defined for your value list to use with that custom function and your check box field.

            • 3. Re: showing 'other' value in value list checkbox
              beverly

              Do you want to show the new values as checkboxes or merely allow them to be added (for a particular record)?

               

              The "checkbox" field is a format applied to a TEXT field (using a value list) of return-delimited words/phrases. So using that knowledge, you can have a global field for entry (or even another field) that "sets" the user-defined list to your field values, but NOT appear as checkboxes (because the value list has not changed, just the contents of the field).

              • 4. Re: showing 'other' value in value list checkbox
                siplus

                moreover, the checkbox formatting of a value list has a delimited width on a layout, so if a user adds "supercalifragilisticexpialidocious" we have a problem.

                1 of 1 people found this helpful
                • 5. Re: showing 'other' value in value list checkbox
                  cwcrogan

                  siplus, I would . I would like to allow the user to add to the field an 'other' value per record, but I don't want to allow them to enter the multi-valued (return delimited) field that the 'other' option allows on a checkbox. This gives them the ability to change the other values, whether deliberately or unintentionally.

                   

                  philmodjunk, yes I'm aware of the other and edit options, their differences, and the fact that other does not change the value list. I'm not looking to change the value list or even add to it. I'm looking to add to the field another option in addition to the value list on a per record basis. As mentioned above, Filemaker's default 'other' option will pop up a dialog box allowing the user to add values, but I know this will only confuse the user in my case. Restated, I want to use Filemaker's 'other' option but not use the popup and after it's entered have that value remain on the layout.

                   

                  So I'd like to give them the option to add a value without that popup. I'm thinking it would be something like adding a field, which if entered would be scripted to add it's contents to the other field in question. On the layout, perhaps give the checkbox field the 'other' option but somehow block the user from checking the 'other' value (inducing the popup), but it would become checked when the script added the non value list value to the field. I would need that value to be displayed somehow - perhaps just keeping that secondary field close the checkbox field.

                   

                  I'm aware of the width issues regarding checkboxes, but this isn't a problem.

                  • 6. Re: showing 'other' value in value list checkbox
                    cwcrogan

                    I don't know if I'm explaining myself well enough, but imagine a paper form with a set of 7 checklist options and an 8th other option with a blank space you could fill in...

                    • 7. Re: showing 'other' value in value list checkbox
                      doughemi

                      Why can't you create a new field ChkbxOther (edit box with bottom border to be an "underline") and position it below the checkbox field? Create a variable $$checkboxExpanded = YourCheckboxField & "¶" & ChkbxOther and call it instead of YourCheckboxField in subsequent operations.

                       

                      You could even create a faux checkbox in front of it, if you really thought it necessary.

                       

                      EDIT: Thinking about it, you would have to use YourCheckboxField & if(not isEmpty (ChkbxOther); "¶" & ChkbxOther; "")

                      • 8. Re: showing 'other' value in value list checkbox
                        beverly

                        that is what I suggested/asked. You can have another field (global?) which can be used for entry and add those values to your "list field". You can also choose to display either field (or both, but limit entry). Checkboxes are convenient for entry (especially removing items). But the underlying field is just return-delimited regardless of how it is populated.

                        beverly

                        • 9. Re: showing 'other' value in value list checkbox
                          cwcrogan

                          Yes, I'm aware the underlying field is just a return-delimited text field and that's what I want. I just want to learn HOW to add the contents of the secondary field to the main field. I guess a script triggered onObjectExit from the second field would be best (except that for the short term they're using FM8). The script would need to check the field for containing data and if found add it to the primary field. But it would also need to remove any data from the primary field that was not part of the value list if the secondary field were empty...

                           

                          And thank you all for your contributions thus far!

                          • 10. Re: showing 'other' value in value list checkbox
                            philmodjunk

                            Set field [ yourTable::checkBoxField ; List ( yourTable::checkBoxField ; YourTable::OtherField ) ]

                             

                            adds other to the field without overwriting other check box values. But removing an other value would take more effort. Both a custom function or a script that basically checks each value against the defined value list might be used.

                             

                            Or you might just keep the Other value in the Other field and not try to add it to the list.

                            • 11. Re: showing 'other' value in value list checkbox
                              cwcrogan

                              Ok, so I've come up with a solution but will only work for FM10 or above. I set up a script triggered OnObjectExit from the secondary field. The script first filters the first text field (checklist field) against the value list leaving only value list items in the field (using FilterValues ( ValueListItems (;) ;) ). Then if the second field is not empty, it appends the second field to the first, if it is empty, the first step has already reduced the first field to just value list items.

                               

                              My problem now is that the user is using FM8 which doesn't have an OnObjectExit script trigger, so I need to find a workaround...

                              • 12. Re: showing 'other' value in value list checkbox
                                cwcrogan

                                Well, I thought I had a solution, but there's a problem. It works when a user is not within the checkbox field. If they attempt to click on 'other', they're actually clicking on a button sending them to the secondary field. Also, if they click or tab into the secondary field the expected result occurs. But when a user is inside the checkbox field, the button covering the 'other' option is underneath and the default popup will occur. Is there a way to keep the button always on top?

                                • 13. Re: showing 'other' value in value list checkbox
                                  philmodjunk

                                  "Or you might just keep the Other value in the Other field and not try to add it to the list."

                                   

                                  Is there any real need to put the "other" value into the check box field? You can put a text field next to the check bos field for that other value. Should you need a combined list of check boxe values and "other", use list ( checkbox field ; other field ).