Text Input

<Image align="center" width="300rt" src="https://files.readme.io/1c49245-TextInput.png" />

The Text Input Web Control inserts boxes that allow app users to input text data.

# Properties

## General

### Placeholder Text

Expects type `text`.

The text that is displayed on the box before the app users enters text. This field expects text to be encapsulated by string quotes.

## Data Binding

### Value

Expects type `text`.

By default, a Variable of type [Text](https://support.airkit.com/v18.0/docs/working-with-text) is generated at the Web Page level to store the data from the input. Users can also edit the Data Binding property and create their own Variables.

### Data Tag

Assigns a data tag on the value of the control. For more information, see [Data Masking and Auditing](https://support.airkit.com/v18.3/docs/data-masking-and-auditing).

## Autocomplete

### Autocomplete

Determines whether the user's device is allowed to autocomplete the field. Guidance can be provided to the app user's browsing environment by using one of the pre-determined autocomplete options such as **name** or **street-address**. For more information, see the [autocomplete attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete).

## Input Format

### Maximum Length

Expects type `number`.

Sets the maximum number of characters that can be inputted. The app user will not be able to type more than this number of characters. This field may accept an expression and expects a number.

### Input Mode

Determines the input-style primarily on mobile devices. For example, if **tel** is selected, most mobile devices will show only a number-pad to enter a phone number. Keep in mind, this does not strictly limit the type of characters that can be entered, use [Format](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode) for this enforcement.

### Format

Determines the type of characters that can be inputted. For example, if **phone** is selected, only numerals can be entered. The selection of this field will also change the Type of data that the input box will expect and give the app builder specific options catered to the input type.

### Delimiter

Displays the symbol that delimits sections of the text as it is entered.

### Prefix

Expects type `string`.

Adds a prefix to the beginning of the user's input.

### No Immediate Prefix

Defers displaying the **Prefix** until there is a value in the field or the field is being edited.

### Raw Value Trim prefix

Trims or removes the prefixed part of the string that has been entered in the **Prefix** field. This only removes the prefix within the variable where the input is stored, the app user will still see the prefix displayed.

## Icon

### Right Icon

Allows the display of icons to the right-hand-side of the input box.

## Accessibility

### Aria Label

Expects type `text`.

Defines a value to the aria-label of the control. For more information, see [here](https://www.w3.org/TR/WCAG20-TECHS/ARIA14.html).

### Aria Invalid

Expects type `text`.

A value of `true` or `false` to indicate that the value entered into an input field is not in a format or a value the application will accept. For more information, see [here](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-invalid)

### Input ID

Expects type `text`.

The Input ID assigned to the Text Input Web Control. This Input ID can tied to a [Label](ref:label-web-control) so that clicking on the associated Label will allow users to enter Text input.

For more on how to use the Input ID, see [Connecting Labels to Input Controls](doc:connecting-labels-to-input-controls).

## State

### Is Visible

Expects type `boolean`.

If `TRUE` the text input will be visible. If `FALSE` the text input will not be displayed. If the field is empty, the text input will be visible.

### Is Disabled

Expects type `boolean`.

If `TRUE` the text input will be disabled and the user will not be able to interact with the control. If `FALSE` the text input will be enabled. If the field is empty, the text input will be enabled.

# Style

The Text Variant has styles for the following states:

**Default** - When first rendered without state\
**Disabled** - When the Text Input is disabled\
**Focused** - when the Text Input is focused

Check [Common style properties of web controls](https://support.airkit.com/docs/web-control-styling-properties) for further details on how to style your this Control.

# Actions

### On Blur

Triggers when the user leaves the input field. That is, when changing the focus from the field to some other part of the application.

### Value Changed

Triggers with each typed letter. That is, Value changes every time a key is pressed, unlike a [Checkbox](https://support.airkit.com/reference/checkbox-web-control), where its Value changes when the box is selected.

### On Enter

Triggers upon pressing Enter.

For more information, check out [Action Inspector Tab](https://support.airkit.com/docs/action-chains) to find all the available action

# Example

Controlling what happens with the inputted data:

<img src="https://a01-support.airkit.com/text-input-web-control/mceclip2.png" alt="organizing info" style={{maxWidth: "400px", width:"100%"}}/>

Data entered into text inputs need to be bound to a variable. By default, Airkit automatically creates a Text Variable for the inputted data to be stored which can be seen within **Inspector > Data Binding**.

In this example, a `text_input` variable has been created which can be used to pass data across web pages, events, data flows and more.