menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class OtpInputEventArgs - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class OtpInputEventArgs

    Provides data for the OnInput event when the value of an input field changes.

    Inheritance
    System.Object
    OtpInputEventArgs
    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 Length - 1 is the last field.

    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 null if this is the first input.

    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.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved