Single-Line
A text box where you can write single line text.
Example
API Methods
setLabel
Sets the label of the text field.
- Method
- Usage
setLabel(label: string): void
// Sets the field's label to 'Address'
a8forms.Input("singlelineId").setLabel("Address")
setPlaceholder
Sets the placeholder as a string that temporarily holds the place for the final data.
- Method
- Usage
setPlaceholder(placeholder: string): void
// Sets the placeholder as 'Enter your Residential Address' in the text field of your Single-Line component
a8forms.Input("singlelineId").setPlaceholder("Enter your Residential Address")
setReadOnly
Sets the ReadOnly flag for this component.
- Method
- Usage
setReadOnly(readOnly: boolean): void
//sets the field to ReadOnly, not editable by the user
a8forms.Input("singlelineId").setReadOnly(true)
// Sets the field to be active, editable by the user
a8forms.Input("singlelineId").setReadOnly(false)
setRequired
Sets a field to be required or not.
- Method
- Usage
setRequired(required: boolean): void
// Sets the field as required
a8forms.Input("singlelineId").setRequired(true)
// Sets the field as not required
a8forms.Input("singlelineId").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("singlelineId").setSize("small")
//Sets the size to medium
a8forms.Input("singlelineId").setSize("medium")
//Sets the size to large
a8forms.Input("singlelineId").setSize("large")
setValue
Sets the value of a field.
- Method
- Usage
setValue(value: string): void
// Sets the value of the singleline field
a8forms.Input("singlelineId").setValue('The SingleLine 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("singlelineId").setVisibility(true)
// setting the visibility false makes the element to not visible
a8forms.Input("singlelineId").setVisibility(false)
setVisibilityCondition
Sets the hide condition
- Method
- Usage
setVisibilityCondition(condition: string): void
// Hides the string
a8forms.Input("singlelineId").setVisibilityCondition("1 == 1");