3 Replies Latest reply on Nov 7, 2013 11:09 AM by philmodjunk

    Exit Field after certain (######) amount of input.

    Gjallandi

      Title

      Exit Field after certain (######) amount of input.

      Post

                     Exit Field after certain (######) amount of input.
                      

                     I am trying to create a function that counts how many numbers I have typed into a field (as I'm typing it in). When the number of letters/numbers typed gets to 6 filemaker should exits the field (or go to next field).

                     This is the only field in this layout.

                     I have spent some time looking, perhaps I'm not using the right words to search, if this has been covered before pleas point me at the post.

           Whit best regards.

            

        • 1. Re: Exit Field after certain (######) amount of input.
          ninja

               If you launch a script "OnObjectModify" that does:

               If (Length (YourField) = 6)

                    ***Go somewhere, do something***

               EndIf

               You'll get what you describe.

               Note that I chose OnObjectModify since it launches AFTER the event.  OnObjectKeystroke launches before the event and might not be the best choice.

          • 2. Re: Exit Field after certain (######) amount of input.
            Gjallandi
                                          wow that was quick, thank you Ninja for your quick response.
                                           
                                     Read your post and maid a script called "6InputLeavelField". The script looked like this:
                                      
                                if [Length (records::IDnumber) = 6]
                              Go to Layout ["Output"] (records)]
                              Go to Layout ["Home"] (records)]

                           End If
                            

                           Script set on the "OnObjectModify" in [edit mode / right click layout / layout setup / script trigger / "OnObjectModify"]

                 I added leaving the layout and entering it again so I would not be inside any fields.
                  

                 Thanks again Ninja.

            • 3. Re: Exit Field after certain (######) amount of input.
              philmodjunk

                   I added leaving the layout and entering it again so I would not be inside any fields.

                   Go to Layout can trip a bunch of script triggers. Commit Records/Requests can also remove the focus from all fields and does so in one step instead of two.