# Events

This article explains the events available in the Telerik DateInput for Blazor:

* [OnBlur](https://www.telerik.com/blazor-ui/documentation/components/dateinput/events#onblur)
* [OnChange](https://www.telerik.com/blazor-ui/documentation/components/dateinput/events#onchange)
* [ValueChanged](https://www.telerik.com/blazor-ui/documentation/components/dateinput/events#valuechanged)

## OnBlur

The `OnBlur` event fires when the component loses focus.

> caption Handle the OnBlur event

<demo metaUrl="client/dateinput/events/onblur/" height="300"></demo>

> tip The event is an `EventCallback`. It can be synchronous and return `void`, or asynchronous and return `async Task`. Do not use `async void`.

## OnChange

The `OnChange` event represents a user action that confirms the current value. It fires when the user presses `Enter` in the input or when the input loses focus.

The event handler receives an `object` argument that you need to cast to the actual `Value` type. The argument can hold a value or be `null`, depending on the user input and the `Value` type.

The DateInput is a generic component, so you must either provide a `Value`, or a type to the `T` parameter of the component.

> caption Handle OnChange and use two-way binding

<demo metaUrl="client/dateinput/events/onchange/" height="300"></demo>

> tip The event is an `EventCallback`. It can be synchronous and return `void`, or asynchronous and return `async Task`. Do not use `async void`.

> tip The `OnChange` event is a custom event and does not interfere with bindings, so you can use it together with models and forms.

## ValueChanged

The `ValueChanged` event fires:

* During typing when the resulting input value is valid.
* On input blur if the input value is not valid and the `Value` type is nullable.

> caption Handle ValueChanged and provide initial value

<demo metaUrl="client/dateinput/events/valuechanged/" height="300"></demo>

> tip The event is an `EventCallback`. It can be synchronous and return `void`, or asynchronous and return `async Task`. Do not use `async void`.

> note The lambda expression in the handler is required by the framework: <https://github.com/aspnet/AspNetCore/issues/12226>.

## See Also

* [ValueChanged and Validation](https://www.telerik.com/blazor-ui/documentation/knowledge-base/value-changed-validation-model)
* [Fire OnChange Only Once](https://www.telerik.com/blazor-ui/documentation/knowledge-base/common-onchange-fires-twice)
