UserGuide

Difference between revisions of "Web Text Field"

From Xojo Documentation

 
Line 6: Line 6:
  
 
== Events ==
 
== Events ==
[[WebTextControl.ValueChanged|ValueChanged]]
+
[[WebTextControl.ValueChanged|ValueChanged]] - Called when the text has been changed, but only after the user has pressed return, enter or the field has lost focus.
:Called when the text has been changed, but only after the user has pressed return, enter or the field has lost focus.
 
  
 
== Properties ==
 
== Properties ==
[[WebEntryField.Hint|Hint]]
+
[[WebEntryField.Hint|Hint]] - Gets or sets the hint text (prompt text) that is displayed within the Text Field.
:Gets or sets the hint text (prompt text) that is displayed within the Text Field.
 
  
[[WebTextField.ReadOnly|ReadOnly]]
+
[[WebTextField.ReadOnly|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.
: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.
 
  
[[WebTextControl.Value|Value]]
+
[[WebTextControl.Value|Value]] - Contains the text displayed in the text field.
:Contains the text displayed in the text field.
 
  
[[WebTextField.FieldType|FieldType]]
+
[[WebTextField.FieldType|FieldType]] - A text field can have these types: Normal, Password, E-Mail Address, Number, Telephone Number, URL (see table below).
:A text field can have these types: Normal, Password, E-Mail Address, Number, Telephone Number, URL (see table below).
 
  
 
== Special Fields ==
 
== Special Fields ==
Line 46: Line 41:
 
== Usage ==
 
== Usage ==
 
To get what the user has typed in a Text Field, use the Value property:
 
To get what the user has typed in a Text Field, use the Value property:
<rbcode>Var firstName As String
+
<rbcode>
firstName = FirstNameField.Value</rbcode>
+
Var firstName As String
 +
firstName = FirstNameField.Value
 +
</rbcode>
  
 
== See Also ==
 
== See Also ==
[[WebTextField]] class; [[UserGuide:Web UI]], [[UserGuide:Web Text Area]] topics
+
[[WebTextField]] class; [[UserGuide:Web Text Area]] topic
  
 
[[Category:User Guide]]
 
[[Category:User Guide]]

Latest revision as of 19:05, 15 February 2021

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

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

Properties

Hint - Gets or sets the hint 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.

Value - Contains the text displayed in the text field.

FieldType - 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

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

Var firstName As String
firstName = FirstNameField.Value

See Also

WebTextField class; UserGuide:Web Text Area topic