5 Replies Latest reply on Jun 15, 2015 7:33 PM by legacy

    Show Textfield if Checkbox is checked

    DenizTgrl

      Title

      Show Textfield if Checkbox is checked

      Post

      Hey guys, 

      I'm working on a project at my new work now and need help. Everything I need to know for now is if there is any possibility to show a Text Field, if a Checkbox is checked or not. So, I got 2 Fields (let's call them "Year Checkbox" declared as a Checkbox with 2 Entries and "Year Text" just there to enter a Text) and Year Text should pop up (maybe in a tiny window) if one of the two entries of Year Checkbox is checked. It is only possible to check 1 entry at the same time. Is there a way to do this?

      Thankful for any kind of advise.

        • 1. Re: Show Textfield if Checkbox is checked
          philmodjunk

          It is only possible to check 1 entry at the same time.

          Then you should use a radio button format instead of check boxes. Check boxes support the selection of multiple values and this is the capability that your users will assume when they see check boxes.

          If you are using FileMaker 13, you can set up the onObjectModify trigger on this field to perform a script that opens a popover containing the text field. You can put a popover on your layout and use the inspector to give the popover panel (not the button) an object name. Then Go to object from the trigger performed script can open the popover.

          If [ Not Isempty ( your table::Radiobuttonfield ) ]
             Go to Object ["PopoverPanelNameHere" ]
          End If

          • 2. Re: Show Textfield if Checkbox is checked
            legacy

            Similar issue, I think.

             

            I have a simple checkbox field and another field to contain a text statement.  The question is when I "check" a checkbox how do I get the second field to display a specific text?

             

            • 3. Re: Show Textfield if Checkbox is checked
              SteveMartino

              Is the 'other field' suppose to be completely empty when you don't select the checkbox?  Can other data be in the other field, or only the pre-defined text statement.

              Simplest way

              1.  Create a checkbox set attached to a value list, with only a custom list of "1"

              2.  Create an OnObjectModify script trigger on the checkbox that does the following:

              Go to Field [Table::TextField] <<your text field

              Select All  <you can forgo this script step if your text field has 'Select entire contents on entry' selected in the inspector

              If [Table::CheckboxField]  <<check to see if the box was checked

                   Set Field [Table::TextField; "Text you want in the field"]

              Else  <<box unchecked, clear field

                   Set Field [Table::TextField; ""]

              End If

              Keep in mind that checking the box will destroy any other data in that text field

              • 4. Re: Show Textfield if Checkbox is checked
                legacy

                The other field where the text statement needs to be populated is normally empty.  It is dedicated to displaying a specific statement (instructions for the user) when the controlling "check box" is checked. 

                Going to try doing what you posted.

                • 5. Re: Show Textfield if Checkbox is checked
                  legacy

                  Works perfect.  Thank you very much for the help.