New to Kendo UI for Vue? Start a free 30-day trial

FormProps

Interface

Represents the props of the Kendo UI for Vue Form component.

Definition

Package:@progress/kendo-vue-form

Properties

errors?

{ [name: string]: string }

Sets validation errors that override the field and form validators.

Use this prop to pass errors directly as an object. The validator prop, in contrast, expects a callback. When both validator and errors set an error for the same field, the errors prop wins.

Example:
vue
<Form :errors="serverErrors" @submit="handleSubmit" :render-form="renderForm" />

When set to true, lets the user submit the Form even when no field is modified.

initialValues?

{ [name: string]: any }

Sets the initial field values of the Form.

When you initialize the Form fields, set initial values for them. Otherwise, some components might throw errors when they switch from uncontrolled to controlled mode.

onChange?

(fieldName: string, value: any, valueGetter: (name: string) => any) => void

Fires each time a field value changes.

The third parameter, valueGetter, lets you read other field values. Use it for cross-field validation or to clear related errors.

Parameters:fieldNamestringvalueanyvalueGetter(name: string) => any
Example:
vue
<Form :on-change="handleChange" :render-form="renderForm" />

onSubmit?

(values: { [name: string]: any }, event: any) => void

Fires when the user clicks the Submit button, at least one field is modified, and the form validation passes. The event name is submit.

Parameters:values{ [name: string]: any }event?any

Fires each time the user clicks the Submit button. The event name is submitclick. Use it in advanced scenarios when you need to handle every submit, even when the form is not valid or not modified.

Parameters:eventFormSubmitClickEvent

Sets the content that the Form renders. It receives the FormRenderProps.

Parameters:propsFormRenderPropsReturns:

any

Sets the validation function for the Form level. The function returns key-value pairs. The key is the field path, and the value is the error message. The function supports nested fields, for example, 'users[0].name'. You can use the same field path to get the value from the values object with the getter function from the kendo-vue-common package. Currently, validator supports only synchronous functions.