UserGuide

Web Text Field

From Xojo Documentation

Text Fields display text in a single-line text entry field, such as the login field seen on many web pages. Use the Set Default Value feature to set the default text for the text field.

Below is a list of common events, properties and methods. For the complete list, refer to WebTextField in the Language Reference.

Events

KeyPressed

Called when a key has been pressed while the field has focus. The Details parameters tells you which key was pressed. Remember that events such as this call back to the server to process the code. Due to latency between the browser and the server you do not want to have time consuming code in this event handler.

TextChanged

Called when the text has been changed, but only after the user has pressed return, enter or the field has lost focus.

Properties

AutoCapitalize, AutoComplete, AutoCorrect

Activates the corresponding feature for iOS browsers. Has no effect on other browsers or platforms.

CueText

Gets or sets the cue text (prompt text) that is displayed within the Text Field.

ReadOnly

Use to get or set the read-only setting. When read-only, the user cannot type in the field, but they can copy text from it.

Text

Contains the text displayed in the text field.

Type

A text field can have these types: Normal, Password, E-Mail Address, Number, Telephone Number, URL (see table below).

Special Fields

In addition to a standard Text Field, a Text Field can also have these special types.

Field Type Description
Password A Text Field with its type preset to Password. This field works on all browsers.
E-mail A Text Field with its type preset to Email. Only supported on iOS.
Number A Text Field with its type preset to Number. Supported on Safari, Chrome and iOS.
Telephone A Text Field with its type preset to Telephone. Only supported on iOS.
URL A Text Field with its type preset to URL. Only supported on iOS.

Usage

Web Text Fields

To get what the user has typed in a Text Field, use the Text property:

Dim firstName As String
firstName = FirstNameField.Text

See Also

WebTextField class; UserGuide:Web UI, UserGuide:Web Text Area topics