See Also

This class has no related objects.

Enumerations

Name Values
Alignments Left
Right
Center
CaseModifiers None
Lower
Upper
EnterKeyHints Enter
Done
Go
NextFocus
PreviousFocus
Search
Send
FieldTypes Text
Color
Date
DateTime
DateTimeLocal
Email
Number
Password
Telephone
Time
Url
Week
Positions Left
Right
States Unvalidated
Valid
Invalid

Constants

Name Type Value
This class exposes no constants.

Events

Definition Parameters Return Type Description
EnterPressed None None Raised when the user presses the Enter key on their keyboard while the field has focus. Simultaneously updates the value server-side. Prevents Default button action.
LabelClick None None Raised when the user clicks the label.
MaskComplete Deprecated None None Raised when the user has completed the assigned Mask, if one is supplied.
StateChanged None None Raised when the user's text has changed the State of the field based on the supplied Pattern.
ValueChanged None None Raised when the user changes the value of the field.

Methods

Definition Description
This class exposes no methods.

Properties

Name Type Default Value Description
CaseModifier CaseModifiers None Controls the capitalization of value text. Also applies to Placeholder.
EnterKeyHint EnterKeyHints Enter Text to display in the Enter button of mobile/virtual keyboards.
FieldStyle GraffitiStyle Nil Style applied to the field portion of the class.
IconHeight Integer 16 Height of IconObject when specified.
IconObject Picture Nil Custom icon displayed in the label portion.
IconWidth Integer 16 Width of IconObject when specified.
Label String “Untitled” Caption of the label portion of the control. Supports FontAwesome icons, IE: <fas fa-search>
LabelAlignment GraffitiWebTextField.Alignments Left Alignment of text and icons in the label portion of the field.
LabelPosition Positions Left The location of the label in relation to the field.
LabelStyle GraffitiStyle Nil Style applied to the label portion of the class.
LabelVisible Boolean True When False, only the text field portion of the component will be displayed.
LabelWidth Integer -1 Static width of label portion. -1 for auto.
Mask Deprecated String “” Mask applied to entered data, see GraffitiWebFieldMask for more information.
MaskPlaceholder Deprecated String “” Placeholder text.
MaskValid Deprecated Boolean False This property is set to True when the user has completed the defined mask.
MaxLength Integer -1 Maximum number of characters that the field can contain. Set to -1 for the maximum HTML limit of 524288.
Pattern String “” For using the browser's built-in RegEx validation (https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern).
PatternInvalidMessage String “” Text to display when the entered text does not confirm to the supplied Pattern. Empty string uses browser default.
PatternSetsState Boolean True Determines whether the conformity of the input text to the supplied Pattern will change the State of the control to be visibly valid or invalid.
ReadOnly Boolean False If True users cannot edit the contents of the field.
Required Boolean False Denotes within the display that this field is required.
State States Unvalidated The validation state of the field.
BaseStyle GraffitiStyle Nil Applies a WebStyle to the background of the component.
Type FieldTypes Text The type of field, not all types are supported by all browsers.
Value String “” The value of the field. Updates on focus loss to reduce communication with the server.

Examples

State

This snippet changes the state of the field based on the length of the field's text:

if me.Value.Len > 3 then
  me.State = GraffitiWebTextField.States.Valid
elseif me.Value.Len > 0 then
  me.State = GraffitiWebTextField.States.Invalid
else
  me.State = GraffitiWebTextField.States.Unvalidated
end if

Notes

Mask Definitions

Character Accepted Inputs
a Alpha character (a-z, A-Z)
9 Numeric character (0-9)
* Alphanumeric character (a-z, A-Z, 0-9)
? Anything after the question mark is considered optional, and the MaskComplete event will fire with or without that section being filled.