Blazor DateTimePicker Example - Validation

DateTime Picker / Validation

This example is used to validate form using the Data Annotation. Type the date and time in the input element or choose a date from the calendar popup and time from the timepicker popup. If the input value is a valid date time value, then the given input will be ready to submit. Otherwise, an error message will be shown until you enter or choose the valid date time.

Loading Syncfusion Blazor Server Demos…

The form enables the validation with data annotation attributes by clicking on the submit externally. All rules are validated by the DataAnnotationsValidator.

The above date time field is configured with the following rules.

Field Rule
Required The field must have a valid date time value.
Range The field must have a date time value within the given range. The date time should be between 5 March 2021, 9 AM and 25 March 2021, 6 PM.
Transform your Blazor web apps today with Syncfusion® Blazor components
100+ high-performance and responsive UI components
Dedicated support
Hassle-free licensing
TRY IT FOR FREE