Capitalize names
If the company style guide states that the first character of first and last names must be uppercase, then a variable action can automatically correct users who are unaware of this rule.
Two variables are required to accomplish the validation and correction. One visible variable that validates the input of the user and another hidden variable that corrects the input of the first variable to the expected format. Only the hidden variable is used in the source code of the text frame in the document.
variable 1: firstname_input
Action type: On change
Action code:
1 declare string temp = stringFunctions toUpperCase string StringFunctions substring string variable firstname_input value
2 startIndex number 0
3 length number 1
4 set local temp = local temp & stringFunctions substring string variable firstname_input value
5 startIndex number 1
6 length stringFunctions length string variable firstname_input value
7 set variable firstname value = local temp
variable 2: firstname
Set to “hidden”
doc. version 6.0.4