Skip to main content

Text Input


The "Text Input" component is used for single-line texts such as for the users' "First Name", and "Last Name" fields.

Text Input Properties

There are four different input types that you can select; they are as follows:

TypeDescription
TextAccepts all forms of text inputs.
PasswordAccepts both texts and numbers. The default password regex is as follows:
(/^(?=.*?[A-Z])(?=(.*[a-z]){1,})(?=(.*[\d]){1,})(?=(.*[\W]){1,})(?!.*\s).{8,}$/;)

Note: On selecting the input type as password, you will note an "eye" button (show password) next to the field. It enables the Hide/Show option for the password for the users. (When "show password" is set to hide, the entered password is rendered as a set of dots - each dot representing a character.)
EmailNeeds to satisfy the following default regex: (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;)
NumberOnly accepts digits. Default regex: (/^[0-9]/;)

note

Regex (Change your regex values as needed.)

To change regex - click on the Validation tab (third icon from the left) at the bottom right of the widgets panel. Select "Pattern" from the validation dropdown. Enter the regex code in the field, and click on "Add". Now, the regex value should be enabled for the input field.


API Methods

setReadOnly

Sets the ReadOnly flag for this component.

setReadOnly(readOnly: boolean): void

setVisibility

Sets the Visibility flag for this component.

setVisibility(visible: boolean): void

setVisibilityCondition

Sets the visibility condition for this component.

setVisibilityCondition(condition: string): void

Event Handlers

Event handlers allow you to set triggers for various actions based on the fired events.

onChange

onChange - Triggers an action every time the user makes a change within the text field (anything that changes the component's "value").

onBlur

onBlur - Sets the action to be performed when the user clicks out of the text field.