4 Replies Latest reply on Mar 1, 2011 4:13 PM by TobyFish

    Question about buttons

    TobyFish

      Title

      Question about buttons

      Post

      The question that i have is: Is there any way to make the appearance of a button on a layout conditional. Otherwise how can i make it so that a button will only apear dependant upon if there is something in a field that i designate, or even if this is possible in filemaker. Thanks for any advice you can give.

        • 1. Re: Question about buttons
          philmodjunk

          Just like a field or layout text, you can use conditional formatting to control the text and fill color of the button. This is often used in Filemaker to change the text color to grey when a button needs to be displayed as "disabled". Please note that the formatting does not control the function of the button--just it's appearance--the button's script has to include code that keeps the script from executing when it is "disabled" as well.

          You can do even more dramatic things with your buttons by using portals, a tab control or a calculation field that returns the contents of 2 or more container fields to make the appearance of the button change completely or even make it disappear entirely.

          • 2. Re: Question about buttons
            TobyFish

            What would i insert into the script then so that it would disable it?

            • 3. Re: Question about buttons
              philmodjunk

              You can't really disable it. You just include the script steps inside an IF EndIF block so that nothing happens when the button is clicked in its "disabled" state. The if step uses essentially the same boolean expression as the conditional format.

              Example:

              Say you disable a button by setting a global variable $$ButtonOff to true.

              The conditional format expression can be simply $$ButtonOff and specify a grey text color.

              Your button's script would look like this:

              If [not $$buttonOff]

                 // steps to what you want to take place when button is not disabled go here

              End If

              • 4. Re: Question about buttons
                TobyFish

                Thank you very much. You have no idea how much this helps.