Events in Blazor OTP Input component
13 Jun 20241 minute to read
This section describes the OTP Input events that will be triggered when appropriate actions are performed. The following events are available in the OTP Input component.
Created
The OTP Input component triggers the Created event when the component rendering is completed.
@using Syncfusion.Blazor.Inputs
<SfOtpInput Created="Created"></SfOtpInput>
@code{
public void Created()
{
// Here, you can customize your code.
}
}
OnFocus
The OTP Input component triggers the OnFocus event when the OTP Input is focused. The OtpFocusInEventArgs passed as an event argument provides the details of the focus event.
@using Syncfusion.Blazor.Inputs
<SfOtpInput OnFocus="OnFocus"></SfOtpInput>
@code{
public void OnFocus(OtpFocusInEventArgs args)
{
// Here, you can customize your code.
}
}
OnBlur
The OTP Input component triggers the OnBlur event when the OTP Input is focused out. The OtpFocusOutEventArgs passed as an event argument provides the details of the blur event.
@using Syncfusion.Blazor.Inputs
<SfOtpInput OnBlur="OnBlur"></SfOtpInput>
@code{
public void OnBlur(OtpFocusOutEventArgs args)
{
// Here, you can customize your code.
}
}
OnInput
The OTP Input component triggers the OnInput event when the value of each OTP Input is changed. The OtpInputEventArgs passed as an event argument provides the details of the each value is changed.
@using Syncfusion.Blazor.Inputs
<SfOtpInput OnInput="OnInput"></SfOtpInput>
@code{
public void OnInput(OtpInputEventArgs args)
{
// Here, you can customize your code.
}
}