This sample code counts the number of characters in a text field. Spaces in the text field are excluded from the count. The final count value is set into a number field.
Make sure to match the Field code of your fields, with the Field code written in the code.
Refer to the Tutorial page, on how to add scripts to your app.