Otp
With the Otp component, you can send a four-digit unique code to the entered mobile number for its verification.
Example
API Methods
setVisibility
Sets if elements of the given category is visible in this view.
- Method
- Usage
setVisibility( value: boolean )
// sets visibility to "true" to make the element visible
a8forms.Otp("OtpFieldId").setVisibility(true)
// sets visibility to "false" to make the element not visible
a8forms.Otp("OtpFieldId").setVisibility(false)
setVisibilityCondition
Sets the hide condition.
- Method
- Usage
setVisibilityCondition( value: Condition ( String ) )
// if the the element's default visibility is true, then the below condition will hide the element
a8forms.Otp("OtpFieldId").setVisibilityCondition("1 == 1")
setSize
Sets the size by only using the parameters passed in.
- Method
- Usage
setSize( value: String - "small" / "medium" / "large" )
// sets the size of the element to 'small'
a8forms.Otp("OtpFieldId").setSize("small")
// sets the size of the element to 'medium'
a8forms.Otp("OtpFieldId").setSize("medium")
// sets the size of the element to 'large'
a8forms.Otp("OtpFieldId").setSize("large")
setLabel
Sets the label of the field.
- Method
- Usage
setLabel( value: String )
// sets the Label of the element to 'Enter OTP'
a8forms.Otp("OtpFieldId").setLabel("Enter OTP")
setRequired
Sets a field as mandatory or not.
- Method
- Usage
setRequried( value: boolean )
// sets the element as a required field
a8forms.Otp("OtpFieldId").setRequired(true)
// sets the element as a not-required field
a8forms.Otp("OtpFieldId").setRequired(false)