4 Replies Latest reply on Aug 4, 2016 11:38 AM by ProdMan

    Count characters as you type in a field

    appt

      Title

      Count characters as you type in a field

      Post

           Hi,

           I want to be able to count the number of characters in a field as you type so that I can write student reports without going over the 320 chracter limit that the school has set. A bit like when you type a text message and it tells you the number of characters you have used.

           I know how to display a calculation in a field that shows the number of characters using the 'Length' code but that only shows when you exit the field.

           Any help much appreciated. It's not a big one as I can live with just displaying the count but live updating would be nice.

           Cheers

           Andy

        • 1. Re: Count characters as you type in a field
          schamblee

               Create your calculation field Length(TextField), Check do not store recalculate as needed.  Create a Script Tigger OnObjectModify on your text field, with a script that commit records then Goto Field Text Field.

          • 2. Re: Count characters as you type in a field
            appt

                 Wow man! You are a star!!!!!!!!

                 Done, working great

                 (How I'll remember what to do in future I dont know!)

                 Karma to you!

                  

                 Andy

            • 3. Re: Count characters as you type in a field
              appt

                   Actually I found a better way after playing with your suggestion which I want to share in case anyone else needs it.

                   On my mac it worked fine as suggested but I am developing for the mac and as you typed it stuttered as it flicked from the character count box to the field and back again using that code.

                   So here is what works on the ipad.

                   2 fields

                   Comment - text field, script trigger onkeystroke

                   CommentCharacter - number (no special options required)

                   script linked to onkeystroke is

                   set field [CommenCharactert; Length ( Comment )]

                   works like a charm on the ipad.

                    

              • 4. Re: Count characters as you type in a field
                ProdMan

                Tried this but it doesn't change the count until I exit the field. Is the script trigger set on the field being counted or the field counting? Maybe a bit dense, sorry, but I really only understand a little bit of the phrase "with a script that commit records then Goto Field Text Field."--I get the "goto" command but don't understand the "commit records". Help?