Class

# WebTextField

<div class="rst-class">

forsearch

</div>

TextField

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

A single line, editable text control. The web equivalent of the `DesktopTextField</api/user_interface/desktop/desktoptextfield>` control.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                              | Type                                               | Read-Only | Shared |
|-------------------------------------------------------------------|----------------------------------------------------|-----------|--------|
| `AllowAutoComplete<webtextfield.allowautocomplete>`               | `Boolean</api/data_types/boolean>`                 |           |        |
| `AllowSpellChecking<webtextfield.allowspellchecking>`             | `Boolean</api/data_types/boolean>`                 |           |        |
| `Caption<webtextfield.caption>`                                   | `String</api/data_types/string>`                   |           |        |
| `ContextualMenu<webtextfield.contextualmenu>`                     | `WebMenuItem</api/user_interface/web/webmenuitem>` |           |        |
| `ControlID<webtextfield.controlid>`                               | `String</api/data_types/string>`                   | ✓         |        |
| `Enabled<webtextfield.enabled>`                                   | `Boolean</api/data_types/boolean>`                 |           |        |
| `FieldType<webtextfield.fieldtype>`                               | `FieldTypes<webtextfield.fieldtypes>`              |           |        |
| `Format<webtextfield.format>`                                     | `String</api/data_types/string>`                   |           |        |
| `Height<webtextfield.height>`                                     | `Integer</api/data_types/integer>`                 |           |        |
| `Hint<webtextfield.hint>`                                         | `String</api/data_types/string>`                   |           |        |
| `Indicator<webtextfield.indicator>`                               | `Indicators<webuicontrol.indicators>`              |           |        |
| `Left<webtextfield.left>`                                         | `Integer</api/data_types/integer>`                 |           |        |
| `LockBottom<webtextfield.lockbottom>`                             | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockHorizontal<webtextfield.lockhorizontal>`                     | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockLeft<webtextfield.lockleft>`                                 | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockRight<webtextfield.lockright>`                               | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockVertical<webtextfield.lockvertical>`                         | `Boolean</api/data_types/boolean>`                 |           |        |
| `MaximumCharactersAllowed<webtextfield.maximumcharactersallowed>` | `Integer</api/data_types/integer>`                 |           |        |
| `Name<webtextfield.name>`                                         | `String</api/data_types/string>`                   | ✓         |        |
| `Page<webtextfield.page>`                                         | `WebPage</api/user_interface/web/webpage>`         | ✓         |        |
| `PanelIndex<webtextfield.panelindex>`                             | `Integer</api/data_types/integer>`                 |           |        |
| `Parent<webtextfield.parent>`                                     | `WebView</api/user_interface/web/webview>`         | ✓         |        |
| `ReadOnly<webtextfield.readonly>`                                 | `Boolean</api/data_types/boolean>`                 |           |        |
| `TabIndex<webtextfield.tabindex>`                                 | `Integer</api/data_types/integer>`                 |           |        |
| `Text<webtextfield.text>`                                         | `String</api/data_types/string>`                   |           |        |
| `TextAlignment<webtextfield.textalignment>`                       | `TextAlignments</api/text/textalignments>`         |           |        |
| `Tooltip<webtextfield.tooltip>`                                   | `WebToolTip</api/user_interface/web/webtooltip>`   |           |        |
| `Top<webtextfield.top>`                                           | `Integer</api/data_types/integer>`                 |           |        |
| `Visible<webtextfield.visible>`                                   | `Boolean</api/data_types/boolean>`                 |           |        |
| `Width<webtextfield.width>`                                       | `Integer</api/data_types/integer>`                 |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                | Parameters                                                                                                                                    | Returns                                      | Shared |
|-----------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|--------|
| `AcceptPictureDrop<webtextfield.acceptpicturedrop>` | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                              |        |
| `AcceptRawDataDrop<webtextfield.acceptrawdatadrop>` | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                              |        |
| `AcceptTextDrop<webtextfield.accepttextdrop>`       | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                              |        |
| `AllowPictureDrag<webtextfield.allowpicturedrag>`   | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                              |        |
| `AllowRawDataDrag<webtextfield.allowrawdatadrag>`   | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                              |        |
| `AllowTextDrag<webtextfield.allowtextdrag>`         | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                              |        |
| `Close<webtextfield.close>`                         |                                                                                                                                               |                                              |        |
| `ExecuteJavaScript<webtextfield.executejavascript>` | script As `String</api/data_types/string>`                                                                                                    |                                              |        |
| `GotoURL<webtextfield.gotourl>`                     | url As `String</api/data_types/string>`, inNewWindow As `Boolean</api/data_types/boolean>` = `False</api/language/false>`                     |                                              |        |
| `SelectAll<webtextfield.selectall>`                 |                                                                                                                                               |                                              |        |
| `SetFocus<webtextfield.setfocus>`                   |                                                                                                                                               |                                              |        |
| `Style<webtextfield.style>`                         |                                                                                                                                               | `WebStyle</api/user_interface/web/webstyle>` |        |
|                                                     | `Assigns</api/language/assigns>` style As `WebStyle</api/user_interface/web/webstyle>`                                                        |                                              |        |
| `UpdateBrowser<webtextfield.updatebrowser>`         |                                                                                                                                               |                                              |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                          | Parameters                                                                                                                                                                                                        | Returns |
|---------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| `Closed<webtextfield.closed>`                                 |                                                                                                                                                                                                                   |         |
| `ContextualMenuSelected<webtextfield.contextualmenuselected>` | hitItem As `WebMenuItem</api/user_interface/web/webmenuitem>`                                                                                                                                                     |         |
| `DropObject<webtextfield.dropobject>`                         | obj As `WebDragItem</api/user_interface/web/webdragitem>`, action As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>`, x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>` |         |
| `FocusLost<webtextfield.focuslost>`                           |                                                                                                                                                                                                                   |         |
| `FocusReceived<webtextfield.focusreceived>`                   |                                                                                                                                                                                                                   |         |
| `Hidden<webtextfield.hidden>`                                 |                                                                                                                                                                                                                   |         |
| `Opening<webtextfield.opening>`                               |                                                                                                                                                                                                                   |         |
| `Shown<webtextfield.shown>`                                   |                                                                                                                                                                                                                   |         |
| `TextChanged<webtextfield.textchanged>`                       |                                                                                                                                                                                                                   |         |

## Enumerations

<div id="webtextfield.fieldtypes">

<div class="rst-class">

forsearch

</div>

</div>

WebTextField.FieldTypes

### FieldTypes

> Specifies the various types of data entry to which the TextField can be constrained on browsers that support such constraints.
>
> | Enum      | Description                                                                                                     |
> |-----------|-----------------------------------------------------------------------------------------------------------------|
> | Normal    | Allows any alphanumeric data to be entered.                                                                     |
> | Password  | Allows any alphanumeric data to be entered but masks the entry with bullets.                                    |
> | Email     | Allows only characters valid in an email address and enforces that the entry be in valid email format.          |
> | Number    | Allows the entry of numbers and the decimal character only.                                                     |
> | Telephone | Allows only characters valid in a telephone number and enforces that the entry be in valid phone number format. |
> | URL       | Allows only characters valid in a URL and enforces that the entry be in valid URL format.                       |

## Property descriptions

<div id="webtextfield.allowautocomplete">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.AllowAutoComplete

**AllowAutoComplete** As `Boolean</api/data_types/boolean>`

> If `True</api/language/true>`, enables the autocomplete feature to complete text entries. The default is `False</api/language/false>`.
>
> ``` xojo
> Me.AllowAutoComplete = True
> ```

<div id="webtextfield.allowspellchecking">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.AllowSpellChecking

**AllowSpellChecking** As `Boolean</api/data_types/boolean>`

> If `True</api/language/true>`, on browsers that support spellchecking, the text of the control will be spell-checked.
>
> This example is in the `Opening<webcontrol.opening>` event of a TextArea:
>
> ``` xojo
> Me.AllowCheckSpelling = True  
> ```

<div id="webtextfield.caption">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Caption

**Caption** As `String</api/data_types/string>`

> The caption of a control.
>
> This property can be set inside the IDE or programmatically.
>
> This code sets the caption of the control to "OK".
>
> ``` xojo
> Me.Caption = "OK"
> ```
>
> This code in the `Pressed<webbutton.pressed>` event handler for a `WebButton</api/user_interface/web/webbutton>` changes the text of the button each time it is pressed:
>
> ``` xojo
> If Me.Caption = "Blue" Then
>   Me.Caption = "Red"
> Else
>   Me.Caption = "Blue"
> End If
> ```

<div id="webtextfield.contextualmenu">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.ContextualMenu

**ContextualMenu** As `WebMenuItem</api/user_interface/web/webmenuitem>`

> If you assign a `WebMenuItem</api/user_interface/web/webmenuitem>` to the control, it will be displayed when the user right-clicks the control.
>
> On a `WebPage</api/user_interface/web/webpage>`, you can disable/remove the default contextual menu by an empty `WebMenuItem</api/user_interface/web/webmenuitem>` class object to this property.
>
> This code populates a contextual menu in the Shown event of the control.
>
> ``` xojo
> Var menu As New WebMenuItem
>
> menu.AddMenuItem("One")
> menu.AddMenuItem("Two")
> menu.AddMenuItem("Three")
> Me.ContextualMenu = menu
> ```
>
> The menu selection is then handled by the ContextualMenuSelected event when the user right-clicks on the control. For example, it can be of the form:
>
> ``` xojo
> Select Case hitItem.Text
> Case "One"
>   MessageBox("One")
> Case "Two"
>   MessageBox("Two")
> Case "Three"
>   MessageBox("Three")
> End Select
> ```

<div id="webtextfield.controlid">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.ControlID

**ControlID** As `String</api/data_types/string>`

> Identifies the control on a per session basis.
>
> This property is read-only.

<div id="webtextfield.enabled">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Enabled

**Enabled** As `Boolean</api/data_types/boolean>`

> When `True</api/language/true>` the **WebControl** is drawn enabled and responds to user action. When `False</api/language/false>`, the control appears as disabled and does not respond to user actions.
>
> In the case of `WebTimer</api/web/webtimer>`, when set to `False</api/language/false>` this disables and stops the WebTimer. When set to `True</api/language/true>`, it starts the WebTimer.
>
> Disable a button when a check box value changes:
>
> ``` xojo
> If AllowSaveCheckBox.Value Then
>   SaveButton.Enabled = True
> Else
>   AllowSaveButton.Enabled = False
> End If
> ```

<div id="webtextfield.fieldtype">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.FieldType

**FieldType** As `FieldTypes<webtextfield.fieldtypes>`

> Specifies the type of data the TextField will handle automatically.
>
> It is up to the browser to decide when to support this. For example, Safari tends to support it only for mobile.
>
> See `FieldTypes<webtextfield.fieldtypes>` for a list of possible types.
>
> Allow numbers only:
>
> ``` xojo
> Me.FieldType = WebTextField.FieldTypes.Number
> ```

<div id="webtextfield.format">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Format

**Format** As `String</api/data_types/string>`

> Formats the contents of the control when it loses the focus.
>
> When setting the Format and Text properties in code, the Format property must be set first in order for the formatting to be applied.
>
> It uses the same formatting conventions as the `Format</api/text/format>` function. To turn off formatting, set the Format property to the empty string, "".
>
> This line applies a dollar format when the user tabs out of the field.
>
> ``` xojo
> Me.Format = "\$###,###.##"
> ```

<div id="webtextfield.height">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Height

**Height** As `Integer</api/data_types/integer>`

> The height (in pixels) of the control.

<div id="webtextfield.hint">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Hint

**Hint** As `String</api/data_types/string>`

> Text that appears inside the control providing a hint about what to enter.
>
> On Windows and Linux, the Hint only appears when the control does not have focus.
>
> This example is in the `Opening<webcontrol.opening>` event of the control:
>
> ``` xojo
> Me.Hint = "Last Name"
> ```

<div id="webtextfield.indicator">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Indicator

**Indicator** As `Indicators<webuicontrol.indicators>`

> The color scheme for the control.

<div id="webtextfield.left">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Left

**Left** As `Integer</api/data_types/integer>`

> The position of the left side of the **WebUIControl** in pixels, relative to the web page.

<div id="webtextfield.lockbottom">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.LockBottom

**LockBottom** As `Boolean</api/data_types/boolean>`

> Determines whether the bottom edge of the control should stay at a set distance from the bottom edge of the parent control, if there is one, or the owning web page.

<div id="webtextfield.lockhorizontal">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.LockHorizontal

**LockHorizontal** As `Boolean</api/data_types/boolean>`

> LockHorizontal overrides LockLeft and LockRight. It allows you to proportionally lock a control's position to the center of its parent control (or web page).
>
> For example, if you place a control in the center of the page and sets both LockHorizontal and LockVertical, the control will stay in the center of the page.

<div id="webtextfield.lockleft">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.LockLeft

**LockLeft** As `Boolean</api/data_types/boolean>`

> Determines whether the left edge of the control should stay at a set distance from the left edge of the parent control, if there is one, or the owning web page.

<div id="webtextfield.lockright">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.LockRight

**LockRight** As `Boolean</api/data_types/boolean>`

> Determines whether the right edge of the control should stay at a set distance from the right edge of the parent control, if there is one, or the owning web page.

<div id="webtextfield.lockvertical">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.LockVertical

**LockVertical** As `Boolean</api/data_types/boolean>`

> LockVertical overrides LockTop and LockBottom. It allows you to proportionally lock a control's position to keep it centered within the parent control or web page.
>
> For example, if you place a control in the center of the page, and sets both LockHorizontal and LockVertical, the control will stay in the center of the page.

<div id="webtextfield.maximumcharactersallowed">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.MaximumCharactersAllowed

**MaximumCharactersAllowed** As `Integer</api/data_types/integer>`

> The maximum number of characters allowed in the input area of the control.
>
> The value of zero does not limit text. This property works for normal text entry, copy and paste, and drag and drop.
>
> This code is in the `Opening<webcontrol.opening>` event of the control. It prohibits more than the specified number of characters:
>
> ``` xojo
> Me.MaximumCharactersAllowed = 10
> ```

<div id="webtextfield.name">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Name

**Name** As `String</api/data_types/string>`

> The name of the control.
>
> This property is read-only.

<div id="webtextfield.page">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Page

**Page** As `WebPage</api/user_interface/web/webpage>`

> Identifies the web page that contains the control.
>
> This property is read-only.

<div id="webtextfield.panelindex">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.PanelIndex

**PanelIndex** As `Integer</api/data_types/integer>`

> If the control has been placed on a <span class="title-ref">WebTabPanel</span> or `WebPagePanel</api/user_interface/web/webpagepanel>` control, this is the panel (page/tab) that the control is on. If the control is not on a panel, it returns -1.
>
> The first panel is numbered zero. If the control has been placed on a panel of a <span class="title-ref">WebTabPanel</span> or `WebPagePanel</api/user_interface/web/webpagepanel>` control, it returns the panel number. If the control is not on a `WebPagePanel</api/user_interface/web/webpagepanel>` or <span class="title-ref">WebTabPanel</span>, it returns -1. If you change the PanelIndex to a nonexistent panel, the control will disappear until you give it a PanelIndex value that corresponds to a panel that exists.
>
> If you are looking to change the currently selected panel (page/tab), use `SelectedPanelIndex<webpagecontrol.selectedpanelindex>`.
>
> This code displays the panel index of the control that is on the page.
>
> ``` xojo
> MessageBox(Me.SelectedPanelIndex.ToString)
> ```

<div id="webtextfield.parent">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Parent

**Parent** As `WebView</api/user_interface/web/webview>`

> Used to get the control's parent control or page. If the parent control is a `WebContainer</api/user_interface/web/webcontainer>`, then it returns the `WebContainer</api/user_interface/web/webcontainer>`. If it is on a `WebPage</api/user_interface/web/webpage>`, it returns the `WebPage</api/user_interface/web/webpage>`.
>
> This property is read-only.

<div id="webtextfield.readonly">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.ReadOnly

**ReadOnly** As `Boolean</api/data_types/boolean>`

> If `True</api/language/true>`, the text of the control cannot be modified.
>
> This example is in the `Opening<webcontrol.opening>` event of the control.
>
> ``` xojo
> Me.ReadOnly = True
> ```

<div id="webtextfield.tabindex">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.TabIndex

**TabIndex** As `Integer</api/data_types/integer>`

> The **WebTextField's** control's position in the Tab Order. The control with a TabIndex of 0 is the first **WebUIControl** to get the focus when the page opens in the browser.
>
> This example sets the control's TabIndex.
>
> ``` xojo
> Me.TabIndex = 2
> ```

<div id="webtextfield.text">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Text

**Text** As `String</api/data_types/string>`

> Specifies the text displayed in the control.
>
> To set the Text for a `WebLabel</api/user_interface/web/weblabel>`:
>
> ``` xojo
> Label1.Text = "Name:"
> ```
>
> To set the Text for a \`WebTextField\`:
>
> ``` xojo
> TextField1.Text = "Bob Roberts"
> ```
>
> To set the Text for a `WebTextArea</api/user_interface/web/webtextarea>`:
>
> ``` xojo
> TextArea1.Text = "1 Main Street" + EndOfLine + "Anytown, NY 12345"
> ```

<div id="webtextfield.textalignment">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.TextAlignment

**TextAlignment** As `TextAlignments</api/text/textalignments>`

> The alignment of the text.

<div id="webtextfield.tooltip">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Tooltip

**Tooltip** As `WebToolTip</api/user_interface/web/webtooltip>`

> Text of a message displayed as a tooltip.
>
> The tip is displayed when the user places the mouse on the control and leaves it there.
>
> This code in the Shown event of a Button sets the tooltip:
>
> ``` xojo
> Me.Tooltip = "Save changes"
> ```

<div id="webtextfield.top">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Top

**Top** As `Integer</api/data_types/integer>`

> The top of the control in local coordinates relative to the web page.

<div id="webtextfield.visible">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Visible

**Visible** As `Boolean</api/data_types/boolean>`

> If `True</api/language/true>`, the control is drawn. If `False</api/language/false>`, it's not.
>
> Hide a control based on a checkbox setting:
>
> ``` xojo
> If ShowEmailCheckbox.Value Then
>   EmailField.Visible = True
> Else
>   EmailField.Visible = False
> End If
> ```

<div id="webtextfield.width">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Width

**Width** As `Integer</api/data_types/integer>`

> The width (in pixels) of the web control.
>
> This code in the Shown event handler increases the size of the control:
>
> ``` xojo
> Me.Width = Me.Width + 50
> ```

## Method descriptions

<div id="webtextfield.acceptpicturedrop">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.AcceptPictureDrop

**AcceptPictureDrop**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to accept a picture drop of a `WebDragItem</api/user_interface/web/webdragitem>`.

<div id="webtextfield.acceptrawdatadrop">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.AcceptRawDataDrop

**AcceptRawDataDrop**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to accept a raw data drop of a `WebDragItem</api/user_interface/web/webdragitem>`.

<div id="webtextfield.accepttextdrop">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.AcceptTextDrop

**AcceptTextDrop**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to accept a picture drop of a `WebDragItem</api/user_interface/web/webdragitem>`.

<div id="webtextfield.allowpicturedrag">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.AllowPictureDrag

**AllowPictureDrag**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to be dragged as a picture.

<div id="webtextfield.allowrawdatadrag">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.AllowRawDataDrag

**AllowRawDataDrag**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to be dragged as raw data.

<div id="webtextfield.allowtextdrag">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.AllowTextDrag

**AllowTextDrag**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to be dragged as text.

<div id="webtextfield.close">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Close

**Close**

> Removes the control from the page.

<div id="webtextfield.executejavascript">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.ExecuteJavaScript

**ExecuteJavaScript**(script As `String</api/data_types/string>`)

> Executes the JavaScript passed. The JavaScript passed can call a JavaScript function in a WebPageSource control.
>
> The Xojo web framework uses EcmaScript 6 which is more strict than previous versions of JavaScript. For more details, see the [EcmaScript 6 documentation](https://www.ecma-international.org/ecma-262/6.0/).
>
> This code in the Pressed event of a Button displays an alert using JavaScript:
>
> ``` xojo
> Me.ExecuteJavaScript("alert('Hello!');")
> ```
>
> This code will select the text in a <span class="title-ref">WebTextField</span> (or WebTextArea):
>
> ``` xojo
> WebTextField1.ExecuteJavascript("document.getElementById('" + _
>   WebTextField1.ControlID + "_inner').select();")
> ```

<div id="webtextfield.style">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Style

**Style** As `WebStyle</api/user_interface/web/webstyle>`

**Style**(`Assigns</api/language/assigns>` style As `WebStyle</api/user_interface/web/webstyle>`)

> The `WebStyle</api/user_interface/web/webstyle>` for the control.
>
> In the `Pressed<webbutton.pressed>` event of a `WebButton</api/user_interface/web/webbutton>`, set the text to bold:
>
> ``` xojo
> Var style As New WebStyle
> style.Bold = True
> Me.Style = style
> ```

<div id="webtextfield.gotourl">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.GotoURL

**GotoURL**(url As `String</api/data_types/string>`, inNewWindow As `Boolean</api/data_types/boolean>` = `False</api/language/false>`)

> Opens the passed *url* in place of the current web page or downloads a file. If *inNewWindow* is `True</api/language/true>`, the browser is asked to open the *url* in a new window.
>
> If the browser has popup windows disabled and *inNewWindow* is `True</api/language/true>`, the method silently fails and the page is not shown.
>
> If *inNewWindow* is `False</api/language/false>`, the running web app is replaced with the specified *url*. If you want to display an external web site within your web app, use the `WebHTMLViewer</api/user_interface/web/webhtmlviewer>` control.
>
> Display a web site in a new popup window:
>
> ``` xojo
> Me.GotoURL("http://www.wikipedia.org", True)
> ```

<div id="webtextfield.selectall">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.SelectAll

**SelectAll**

> Selects all of the text in the control. If there is no text in the control, SelectAll does nothing.
>
> This example selects all the text in the control.
>
> ``` xojo
> TextArea1.SelectAll
> ```

<div id="webtextfield.setfocus">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.SetFocus

**SetFocus**

> Sets the focus to the `Control</api/user_interface/web/webuicontrol>`.
>
> This code checks for a required text when a button is pressed:
>
> ``` xojo
> If UserNameField.Text.IsEmpty Then
>   MessageBox("Please enter your UserName.")
>   UserNameField.SetFocus
>   Return
> End If
> ```

<div id="webtextfield.updatebrowser">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.UpdateBrowser

**UpdateBrowser**

> Forces the current values of the control to be sent to the browser.
>
> This method is useful when you are computing values in a loop and wish to update the browser immediately rather than wait until the current method ends.
>
> This code iterates through a `RowSet</api/databases/rowset>` of `database rows</api/databases/databaserow>`, updates a `ProgressBar</api/user_interface/web/webprogressbar>` and then forces the updated `ProgressBar</api/user_interface/web/webprogressbar>` to be sent to the browser via UpdateBrowser.
>
> ``` xojo
> ProgressBar1.MaximumValue = SalesData.RowCount
> For Each row As DatabaseRow in SalesData
>   AnalyzeSales(row)
>   ProgressBar1.Value = ProgressBar1.Value + 1
>   ProgressBar1.UpdateBrowser
> Next
> ```

## Event descriptions

<div id="webtextfield.closed">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Closed

**Closed**

> The control has been removed from the browser either because the page has closed or the control's Close method was called.

<div id="webtextfield.contextualmenuselected">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.ContextualMenuSelected

**ContextualMenuSelected**(hitItem As `WebMenuItem</api/user_interface/web/webmenuitem>`)

> Called when a contextual menu item is selected. This selected item is contained in *hitItem*.
>
> This code populates a contextual menu in the Opening event of a `WebToolbar</api/user_interface/web/webtoolbar>`:
>
> ``` xojo
> Var menu As New WebMenuItem
>
> menu.AddMenuItem("One")
> menu.AddMenuItem("Two")
> menu.AddMenuItem("Three")
> Me.ContextualMenu = menu
> ```
>
> The menu selection is then handled by the ContextualMenuSelected event when the user right-clicks on the control. For example, it can be of the form:
>
> ``` xojo
> Select Case hitItem.Text
> Case "One"
>   MessageBox("One")
> Case "Two"
>   MessageBox("Two")
> Case "Three"
>   MessageBox("Three")
> End Select
> ```

<div id="webtextfield.dropobject">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.DropObject

**DropObject**(obj As `WebDragItem</api/user_interface/web/webdragitem>`, action As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>`, x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>`)

> Called when a dragged item is over a control that can accept it. The dragged item is contained in *obj* and the type of drag is identified by *action*.

<div id="webtextfield.focuslost">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.FocusLost

**FocusLost**

> The control has lost the focus.

<div id="webtextfield.focusreceived">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.FocusReceived

**FocusReceived**

> The control has received the focus and has a selection rectangle around it.

<div id="webtextfield.hidden">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Hidden

**Hidden**

> The control is about to become no longer visible. This could be because the page is being closed, is being replaced as the foreground page by another page or because the control or a parent control's Visible property has been set to `False</api/language/false>`.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> This event is equivalent to the `DesktopWindow.Deactivated<desktopwindow.deactivated>` event in a desktop app.
>
> </div>

<div id="webtextfield.opening">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Opening

**Opening**

> The control has been created and the page is opening but has not been sent to the browser yet.
>
> The Opening event handler can be used to initialize non-visual properties and settings for controls.
>
> In most cases, you should use the `Shown<webuicontrol.shown>` event to initialize controls.

<div id="webtextfield.shown">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.Shown

**Shown**

> The control has appeared on the currently displayed page. This could be because its parent page just finished loading, its parent page has come to the foreground or the control is now visible having been previously invisible because it or its parent control's Visible property has been set to `True</api/language/true>`.
>
> Use the Shown event for initializing your controls or doing anything that would interact with other controls or user interface elements on the web page instead of the `Opening<webcontrol.opening>` event.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> This event is the web equivalent to the `DesktopWindow.Activated<desktopwindow.activated>` event.
>
> </div>

<div id="webtextfield.textchanged">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebTextField.TextChanged

**TextChanged**

> The text in the control has changed. The event fires only when the user has stopped typing for a short period.
>
> Currently in both Google Chrome and Microsoft Edge, the autofill feature of these browsers does not trigger this event.
>
> This event handler is not called for `WebLabel</api/user_interface/web/weblabel>` since its Text property cannot be modified by the user.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> If you like to handle `Enter` and `ESC` keys, you should add a Button to the layout and use Default/Cancel properties.
>
> </div>
>
> Display the text typed by the user:
>
> ``` xojo
> MessageBox(Me.Text)
> ```

## Sample code

Display text in the textfield:

``` xojo
TextField1.Text = "Hello, World!"
```

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | Web |
| **Operating Systems** | All |

<div class="seealso">

`WebTextControl</api/user_interface/web/webtextcontrol>` parent class; `WebLabel</api/user_interface/web/weblabel>`, `WebTextArea</api/user_interface/web/webtextarea>`, `WebSearchField</api/user_interface/web/websearchfield>`

</div>
