It is used for taking text inputs from the user, it defines a field for an Email address. The input value is automatically validated to ensure that it is a properly formatted e-mail address.
Example
API Methods
setLabel
Sets the label of the Email field.
- Method
- Usage
setLabel(label: string): void
// Sets the field's label to 'Email'
a8forms.Input("emailId").setLabel("Email")
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 Email ID' in the text field of your Email component
a8forms.Input("emailId").setPlaceholder("Enter your Email ID")
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("emailId").setReadOnly(true)
// Sets the field to be active, editable by the user
a8forms.Input("emailId").setReadOnly(false)
setRequired
Sets a field to be required or not.
- Method
- Usage
setRequired(required: boolean): void
// Sets the field as required
a8forms.Input("emailId").setRequired(true)
// Sets the field as not required
a8forms.Input("emailId").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("emailId").setSize("small")
//Sets the size to medium
a8forms.Input("emailId").setSize("medium")
//Sets the size to large
a8forms.Input("emailId").setSize("large")
setValue
Sets the value of a field.
- Method
- Usage
setValue(value: string): void
// Sets the value of the email field
a8forms.Input("emailId").setValue('The Email 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("emailId").setVisibility(true)
// setting the visibility false makes the element to not visible
a8forms.Input("emailId").setVisibility(false)
setVisibilityCondition
Sets the hide condition
- Method
- Usage
setVisibilityCondition(condition: string): void
// Hides the string
a8forms.Input("emailId").setVisibilityCondition("1 == 1");