# Custom Validation Messages

The Scheduler provides a functionality where you can define your own custom validation messages. The validation messages for each field can be defined through the [validator](https://www.telerik.com/kendo-vue-ui-develop/components/scheduler/api/schedulerprops#validator) property of the component. The validator property can be used in scenarios with both:

* [Default Edit Form](https://www.telerik.com/kendo-vue-ui-develop/components/scheduler/editing/custom-validation-messages#validation-messages-with-the-default-edit-form)
* [Custom Edit Form](https://www.telerik.com/kendo-vue-ui-develop/components/scheduler/editing/custom-validation-messages#validation-messages-with-a-custom-edit-form)

By defining a validation message for selected field, you are making it required in the Edit Form.

## Validation messages with the default Edit Form

The following example demonstrates how we can define custom validation messages for the `Description` and `Rooms` fields in the Edit Form.

[Demo Source](https://demos.telerik.com/kendo-vue-ui/scheduler/data-operations/editing/validation/using-default-form/source.txt)

The example uses the following `validator` method that is passed to the [validator](https://www.telerik.com/kendo-vue-ui-develop/components/scheduler/api/schedulerprops#validator) prop of the `Scheduler`.

```jsx
validator(formValueGetter) {
    const desc = formValueGetter('description');
    const roomId = formValueGetter('roomId');
    return {
    description: desc ? undefined : 'Please add event description',
    roomId: roomId ? undefined : 'Please select a room for the event',
    };
}
```

## Validation messages with a custom Edit Form

The Scheduler gives us the freedom to define custom messages in scenarios with [custom Edit Form](https://www.telerik.com/kendo-vue-ui-develop/components/scheduler/editing/custom-form). The validation messages in such scenarios are set in a similar way to the scenarios with the built-in Edit Form.

In the following example, you can see how the `Event Title` and `Event Description` fields are set as required ones and have custom validation messages.

[Demo Source](https://demos.telerik.com/kendo-vue-ui/scheduler/data-operations/editing/validation/using-custom-form/source.txt)

The the example uses the [validator](https://www.telerik.com/kendo-vue-ui-develop/components/scheduler/api/schedulerprops#validator) property to which we pass the following method:

```jsx
validator(formValueGetter) {
    const desc = formValueGetter('description');
    const title = formValueGetter('title');
    return {
    title: title ? undefined : 'The event should have a title',
    description: desc ? undefined : 'Please add event description',
    };
},
```

## Suggested Links

* [Scheduler Editing - Basic configuration](https://www.telerik.com/kendo-vue-ui-develop/components/scheduler/editing)
* [Scheduler - Custom Edit Form](https://www.telerik.com/kendo-vue-ui-develop/components/scheduler/editing/custom-form)
* [Scheduler - Set Edit Form initial values](https://www.telerik.com/kendo-vue-ui-develop/components/scheduler/editing/default-values)
* [API Reference of the SchedulerFormEditor](https://www.telerik.com/kendo-vue-ui-develop/components/scheduler/api/schedulerformeditorprops)
* [Kendo UI for Vue Form](https://www.telerik.com/kendo-vue-ui-develop/components/form)
