# DateTimePicker Forms Support

You can use the DateTimePicker in [Template-driven](https://www.telerik.com/kendo-angular-ui/components/dateinputs/datetimepicker/forms#template-driven-forms) and [Reactive](https://www.telerik.com/kendo-angular-ui/components/dateinputs/datetimepicker/forms#reactive-forms) forms.

## Template-Driven Forms

The template-driven forms enable you to bind the DateTimePicker to the model by using the [`ngModel`](https://angular.dev/guide/forms) directive.

The following example demonstrates how to use the DateTimePicker in template-driven forms.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/dateinputs/datetimepicker/forms/template_driven/source.txt)

## Reactive Forms

Reactive forms use the `FormGroup` class to manage the form state. Bind the DateTimePicker to a control in the group by using the `formControlName` or `formControl` directive. For more details, refer to the [Angular documentation](https://angular.dev/guide/forms/reactive-forms).

The following example demonstrates how to use the DateTimePicker in a reactive form.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/dateinputs/datetimepicker/forms/reactive/source.txt)

## Managing the DateTimePicker Disabled State in Reactive Forms

To disable the DateTimePicker component when working with reactive forms and Angular 15 or later, use the FormControl's [`disabled` property/option](https://angular.dev/api/forms/AbstractControl#disabled) or [`disable()` method](https://angular.dev/api/forms/AbstractControl#disable).

> Since Angular 15, the [`setDisabledState`](https://angular.dev/api/forms/ControlValueAccessor#setDisabledState) method of the control value accessor is [always called](https://github.com/angular/angular/pull/47576) to sync the disabled state with the model. As a result, the [`disabled`](https://www.telerik.com/kendo-angular-ui/components/dateinputs/api/datetimepickercomponent#disabled) property of the DateTimePicker no longer disables the component in reactive forms. Set the disabled state through the FormControl instead.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/dateinputs/datetimepicker/forms/reactive-forms-disabled/source.txt)

## FormField Association

The [Kendo UI for Angular FormField component](https://www.telerik.com/kendo-angular-ui/components/inputs/form/formfield) enables you to group form-related elements, such as inputs, labels, hint and error messages, and configure their behavior.

The following example demonstrates how to use the DateTimePicker within a FormField with hint and error messages.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/dateinputs/datetimepicker/forms/formfield/source.txt)

## Suggested Links

* [API Reference of the DateTimePicker](https://www.telerik.com/kendo-angular-ui/components/dateinputs/api/datetimepickercomponent)
* [Angular DateTime Picker](https://www.telerik.com/kendo-angular-ui/datetimepicker)
