# Select the Day Segment in an Empty DateInput

## Environment

* Product: Telerik UI for ASP.NET MVC DateInput
* Framework: ASP.NET MVC
* Client-side version tested: 2026.3.1015
* Browser tested: Chromium

## Description

How can I position the cursor on the day segment when an empty DateInput receives focus or a click?

The DateInput has no configuration option for selecting the initial date segment. Use a DOM event handler with either the HtmlHelper or TagHelper.

## Solution

The following example assumes that you have [configured Telerik UI for ASP.NET MVC](https://www.telerik.com/aspnet-mvc/documentation/getting-started-mvc/first-steps) in your application.

1. Configure an empty DateInput with the fixed `dd/MM/yyyy` format and explicit, nonempty segment messages.
2. After initialization, handle the input element's DOM `focus` and `click` events.
3. Check both the widget value and the displayed mask to avoid changing populated or partially entered dates.
4. Use `requestAnimationFrame` to select the day after the component processes the interaction.

Choose one of the following declarations:

```Razor HtmlHelper
    @(Html.Kendo().DateInput()
        .Name("dateinput")
        .Format("dd/MM/yyyy")
        .Messages(messages => messages
            .Day("dd")
            .Month("MM")
            .Year("yyyy")
        )
    )
```

Place this script after the chosen component declaration:

```JavaScript
    <script>
        $(document).ready(function () {
            var dateInput = $("#dateinput").data("kendoDateInput");

            dateInput.element.on("focus click", function () {
                var input = this;

                if (dateInput.value() === null && input.value === "dd/MM/yyyy") {
                    requestAnimationFrame(function () {
                        if (document.activeElement === input && input.value === "dd/MM/yyyy") {
                            input.setSelectionRange(0, 2);
                        }
                    });
                }
            });
        });
    </script>
```

Tab into the empty input or click it. The day placeholder is selected, and typing replaces that segment. Populated dates and partially entered dates retain their normal editing behavior.

This example depends on the specified format and messages. If you change the date order, separators, or localized messages, update the empty-mask comparison and selection offsets.

## See Also

* [DateInput Date Editing](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/dateinput/date-editing)
* [DateInput Localization](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/dateinput/globalization/localization)
* [DateInput Client-Side API](https://docs.telerik.com/kendo-ui/api/ui/dateinput)
