Class OtpInputEventArgs
Provides data for the OnInput event when the value of an input field changes.
Inheritance
Namespace: Syncfusion.Blazor.Inputs
Assembly: Syncfusion.Blazor.dll
Syntax
public class OtpInputEventArgs : Object
Remarks
This class contains detailed information about value changes, including both the previous and current values, as well as which specific input field triggered the change. This enables implementing sophisticated validation logic and user experience enhancements.
Constructors
OtpInputEventArgs()
Declaration
public OtpInputEventArgs()
Properties
Index
Gets or sets the zero-based index of the input field that triggered this change event.
Declaration
public int Index { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | An integer representing the position of the input field that was modified,
where 0 is the first field and |
Remarks
This property identifies which specific input field caused the value change, enabling field-specific validation, formatting, or user interface updates.
PreviousValue
Gets or sets the value of the SfOtpInput component before the current change occurred.
Declaration
public string PreviousValue { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the previous complete OTP value, or |
Remarks
This property is useful for implementing undo functionality, change detection logic, or validation that depends on the previous state of the input.
Value
Gets or sets the current value of the SfOtpInput component after the change.
Declaration
public string Value { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the current complete OTP value with all field values concatenated. |
Remarks
For Number inputs, this value will contain only valid numeric characters. For other input types, it includes all entered characters from all fields.