New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Events

Client-side Events of the Telerik WebForms OTPInput component.

Load

Fires when the OTPInput component and its kendo widget is fully initialized.

Event data

  • sender - Telerik.Web.UI.RadOTPInput - The OTPInput instance that triggered the event.

Example

JavaScript
function onLoad(sender, args) {
    let otpInput = sender; // Telerik.Web.UI.RadOTPInput
    let kendoOTPInput = otpInput.get_kendoWidget(); // kendo.ui.OTPInput
}

Attaching the event

In the Markup
ASP.NET
<telerik:RadOTPInput ID="RadOTPInput1" runat="server" Separator="-">
    <ItemsCollection>
        <telerik:OTPInputItem GroupLength="3" />
        <telerik:OTPInputItem GroupLength="3" />
    </ItemsCollection>
    <ClientEvents OnLoad="onLoad" />
</telerik:RadOTPInput>
On Client-side
JavaScript
function pageLoadHandler() {
    let otpInput = $find("<%=  RadOTPInput1.ClientID %>");

    otpInput.add_load(onLoad);
}

Sys.Application.add_load(pageLoadHandler);
On Server-side
C#
protected void Page_PreInit(object sender, EventArgs e)
{
    RadOTPInput1.ClientEvents.OnLoad = "onLoad";
}

Change

Triggered when the value of the control is changed by the user.

Event data

  • sender - Telerik.Web.UI.RadOTPInput - The OTPInput instance that triggered the event.
  • args - Sys.UI.DomEvent - Instance of a DomEvent Class that is part of ASP.NET AJAX, see Sys.UI.DomEvent Class.
PropertyReturn TypeDescription
get_value()stringThe typed value

Attaching the event

In the Markup
ASP.NET
<telerik:RadOTPInput ID="RadOTPInput1" runat="server" Separator="-">
    <ItemsCollection>
        <telerik:OTPInputItem GroupLength="3" />
        <telerik:OTPInputItem GroupLength="3" />
    </ItemsCollection>
    <ClientEvents OnChange="onChange" />
</telerik:RadOTPInput>
On Server-Side
C#
protected void Page_PreInit(object sender, EventArgs e)
{
    RadOTPInput1.ClientEvents.OnChange = "onChange";
}
Event Function
JavaScript
function onChange(sender, args) {
    let value = args.get_value();
}
In this article
LoadChange
Not finding the help you need?
Contact Support