2 Replies Latest reply on May 30, 2013 9:54 AM by MorkAfur

    How to Change a button's text at runtime?

    MorkAfur

      Title

      How to Change a button's text at runtime?

      Post


           I would like to be able to change the text of a button so it acts like a toggle.

           Our application is a simple user "check-in" application.

           When the user clicks the "Check-in" button, I want to be able to change the caption to "Undo Checkin" in case the user clicked the wrong row.

           Then in the associated script, within the logic, read the current button's text caption and decide what to do with the data, then, toggle th button text again.

           How would this best be done in FMP 12?

           Thanks in advance,

           -m

        • 1. Re: How to Change a button's text at runtime?
          philmodjunk

               You have options--none of which use the actual "button text" that's part of the button setup. You leave the button unlabeled but then place either a merge variable or a field on top of the button. If you use a field, you can either, use a merge field, a regular field with access behavior blocked or you can group the field with the button's graphic option before you set it up as a button.

               With all of these, you then use the button's script to alter the value of the field or variable to change it's name and you may need a script trigger to perform a script that sets the button's original label if you use a variable or a field with global storage.

          • 2. Re: How to Change a button's text at runtime?
            MorkAfur

                 Thanks very much, Phil.

                 These options sound totally workable.

                 Appreciate the time you took to leave such a great reply. :)

                 -- m