KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Tracking the number of characters entered in a text field
PRODUCT: 4D | VERSION: 2004.4 | PLATFORM: Mac & Win
Published On: October 30, 2006

The code below shows how to track the number of characters entered as you enter them in a text field. The On After Keystroke event has to be turned on for the text object where the code below is placed in its object method. As shown, the text is retrieved as it is entered and the length of this text is assigned to a variable.

If (Form event=On After Keystroke )
   $enteredText:=Get edited text
   TextLength:=Length($enteredText)
End if