The TextInput control is a single-line text field that is optionally editable. All text in the TextInput control must use the same styling unless it is HTML text. The TextInput control supports the HTML rendering capabilities of the Macromedia Flash Player. The TextInput control, like other input and choice controls, can have a required value indicator when used in a FormItem control in a Form container.
TextInput controls do not include a label, although you can add one by using a Label control or by nesting the TextInput control in a FormItem control in a Form container. TextInput controls indicate whether a value is required. TextInput controls have a number of states, including filled, selected, disabled, and error. TextInput controls support formatting, validation, keyboard equivalents; they also broadcast change and enter events.
If you disable a TextInput control, it displays contents in a different color, represented by the disabledColor style. To disallow editing the text, you set the editable property to false. To conceal the input text by displaying asterisks instead of the characters entered, you set a TextInput control`s password property.
MXML Syntax
The <mx:TextInput> tag inherits all the properties of its parent classes, and the following properties:
<mx:TextInput
editable="true|false"
hPosition="0"
htmlText="No default."
maxChars="undefined"
maxHPosition="0"
password="false|true"
restrict="null"
text="No default."
borderStyle="inset|solid|none|outset"
change="Event handler; no default."
enter="Event handler; no default."
/>
See Also
mx.controls.TextArea
| Methods |
| Methods inherited from class mx.core.UIComponent |
getFocus
setFocus
getFocusManager
|
| Properties | |
static | version:String
ComponentVersion is for internal use only. |
| className:String
Name of this class. |
| html:Boolean
[Read-Write]
If true, text is supplied as HTML. |
| text:String
[Read-Write]
Text string that appears in the control. |
| htmlText:String
[Read-Write]
Contains HTML formatted text. |
| maxChars:Number
[Read-Write]
Maximum number of characters that the text field can contain. |
| length:Number
[Read-Only]
Length of text in the component. |
| restrict:String
[Read-Write]
Set of characters that a user can enter into the text field. |
| hPosition:Number
[Read-Write]
Pixel position of the left-most character that is currently displayed. |
| maxHPosition:Number
[Read-Only]
Maximum value of hPosition. |
| editable:Boolean
[Read-Write]
If true, the user can edit the text. |
| password:Boolean
[Read-Write]
Whether the field is a password field, true or not, false. |
| tabIndex:Number
[Read-Write]
Tab order for navigating with the tab key. |
| Properties inherited from class mx.core.UIComponent |
version
enabled
tabIndex
|
| Effects |
| Effects inherited from class mx.core.UIComponent |
showEffect
hideEffect
focusInEffect
focusOutEffect
|
| Effects inherited from class mx.core.UIObject |
creationCompleteEffect
moveEffect
resizeEffect
mouseDownEffect
mouseOverEffect
mouseOutEffect
mouseUpEffect
|
| Events | |
change | Handler for change events, which are broadcast when text in the TextInput control changes. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
enter | Handler for enter events, which are broadcast when the user presses the Enter key. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
| Events inherited from class: mx.core.UIComponent |
focusIn
focusOut
keyDown
keyUp
show
hide
valid
invalid
valueCommitted
|
| Styles | |
disabledColor |
Type: Number
Format: Color
CSS Inheritance: yes
Disabled color of the TextInput. |
| Styles inherited from class mx.core.UIObject |
color
fontFamily
fontSize
fontStyle
fontWeight
textAlign
textDecoration
textIndent
marginLeft
marginRight
horizontalGap
verticalGap
|
| Property Detail |
className:String
editable:Boolean
[Read-Write]
hPosition:Number
[Read-Write]
html:Boolean
[Read-Write]
htmlText:String
[Read-Write]
length:Number
[Read-Only]
maxChars:Number
[Read-Write]
maxHPosition:Number
[Read-Only]
password:Boolean
[Read-Write]
restrict:String
[Read-Write]
tabIndex:Number
[Read-Write]
text:String
[Read-Write]
static version:String