Text
Alternatively referred to as a text field. It is a text box component in a form that allows a user to enter text.
Example
API Methods
setLabel
Sets the label of the Text.
- Method
- Usage
setLabel(label: string): void
// Sets the field's label to 'Weather Report'
a8forms.Input("textId").setLabel("Weather Report")
setPlaceholder
Sets the placeholder as a string that temporarily holds the place to the final data.
- Method
- Usage
setPlaceholder(placeholder: string): void
// Sets the placeholder as Email in a text field
a8forms.Input("textId").setPlaceholder("Email")
setReadOnly
Sets the ReadOnly flag for this context.
- Method
- Usage
setReadOnly(readOnly: boolean): void
//sets the field to ReadOnly not editable by the user
a8forms.Input("textId").setReadOnly(true)
// Sets the field to be active, editable by the user
a8forms.Input("textId").setReadOnly(false)
setRequired
Sets a field to be required or not.
- Method
- Usage
setRequired(required: boolean): void
// Sets the field as required
a8forms.Input("textId").setRequired(true)
// Sets the field as not required
a8forms.Input("textId").setRequired(false)
setSize
Sets the size only using the parameters passed in.
- Method
- Usage
setSize(size: "small" | "medium" | "large"): void
//Sets the size to small
a8forms.Input("textId").setSize("small")
//Sets the size to medium
a8forms.Input("textId").setSize("medium")
//Sets the size to large
a8forms.Input("textId").setSize("large")
setValue
Sets the value of a field.
- Method
- Usage
setValue(value: string): void
// Sets the value of a text field
a8forms.Input("textId").setValue('A Text Value');
setVisibility
Sets if elements of the given category is visible in this view.
- Method
- Usage
setVisibility(visible: boolean): void
// setting the visibility true makes the element to visible
a8forms.Input("<textId>").setVisibility(true)
// setting the visibility false makes the element to not visible
a8forms.Input("textId").setVisibility(false)
setVisibilityCondition
Sets the hide condition
- Method
- Usage
setVisibilityCondition(condition: string): void
// Hides the string
a8forms.Input("textId").setVisibilityCondition("1 == 1");