change
Fired when the value of the widget is changed by the user.
The event handler function context (available through the keyword this
) will be set to the widget instance.
Important: The event is not fired when the value of the widget is changed from code.
Event Data
e.sender kendo.ui.OTPInput
The widget instance which fired the event.
Example - subscribe to the "change" event during initialization
<input id="otpinput" />
<script>
$("#otpinput").kendoOTPInput({
items: 3,
change: function(e) {
var value = this.value();
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(value);
// Use the value of the widget
}
});
</script>
Example - subscribe to the "change" event after initialization
<input id="otpinput" />
<script>
function otpChange(e) {
var value = this.value();
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(value);
// Use the value of the widget
};
$("#otpinput").kendoOTPInput({
items: 3
});
var otpInput = $("#otpinput").data("kendoOTPInput");
otpInput.bind("change", otpChange);
</script>