ProblemYou want to create a password-style text field that hides the characters as asterisks. You also want to disable copying from the text field. SolutionSet the text field's password property to true. DiscussionWhen a user enters a password into a field, you generally want to make it so others aren't able to read the password. This is a basic security precaution. The common convention is to display only asterisks in the field as the user types. This way, the user can see that she is successfully entering a value without anyone else being able to easily read what she's just typed. To create an input field that is automatically masked with asterisks, you only need to set the TextField .password property to TRue: field.password = true; When you set the password property to true, all text entered into the text field, either programmatically or by user input, displays as asterisks: field.password = true; field.text = "example text"; // Text field displays: ************ Password text fields also disable copying from the text field. That prevents a user from being able to copy passwords or similar data and then paste it into a plain text document. Password text fields are most commonly also input text fields; however, you can set the password property to TRue for a dynamic text field as well.
|