The Text Input object is an entry field that allow you to provide your users with a place to enter text or numeric information. Use Text Input objects to create fill in the blank forms, record answers to essay questions or collect just about any other type of information. The information may be stored in a variable, used in calculations or sent to a server script to be stored in a database.
The Text Input object corresponds to the <input type="text"> HTML tag.
To create a Text Input object, use the mouse to draw a rectangle where you want the field to appear. The Text Input properties can be accessed from the Properties Panel, allowing you to define the appearance and behaviour.
- id: use this property to set a unique name for your Text Input. It will allow you later to modify its properties programatically.
- initial-value: add here some text only if you want the Text Input to be prefilled with that text.
- max-length: put here a number to limit the maximun characters allowed on the Text Input.
- place-holder: this attribute specifies a short hint that describes the expected value of an input field (e.g. a sample value or a short description of the expected format). The short hint is displayed in the input field before the user enters a value.
- property-name: this is important if you want to send the data from a Form with a Text Input to a server. The server script will get the value associated to this property name. See Form object for more info.
- variable: if you want to store the Text Input data into a variable to keep track of its content, just add the variable name using brackets into the variable property (ie: [name]). For more information see Understanding Actions and Variables.
At runtime, the variable will contain whatever has been typed into the field. You can modify the contents of the Text Input object by manipulating the variable using a simple Action Command. For example:
SetVar "[username]" "John Doe"
Similarly, you can clear the contents of the Text Input object like this:
SetVar "[username]" ""