validateField

Fired when the validation state of a field changes.

Event Data

e.sender kendo.ui.Form

The Form instance which fired the event.

e.valid Boolean

The validation state of the field - true or false.

e.model Object

The form model.

e.error String

Contains the validation error if the state is not valid.

e.input jQuery

The validated input.

Example - subscribe to the "validateField" event during initialization

<form id="myForm"></form>

<script>
    $("#myForm").kendoForm({
        formData: {
            ID: 1,
            Name: "Ivan",
            Address: "Sofia"
        },
        items: [{
            field: "Name",
            label: "Name:",
            validation: { required: true }
        }, {
            field: "Address",
            label: "Address:",
            validation: { required: true }
        }],
        validateField: function(ev) {
/* The result can be observed in the DevTools(F12) console of the browser. */
            console.log(ev);
        }
    });
</script>

Example - subscribe to the "validateField" event after initialization

<form id="myForm"></form>

<script>
    var form = $("#myForm").kendoForm({
        formData: {
            ID: 1,
            Name: "Ivan",
            Address: "Sofia"
        },
        items: [{
            field: "Name",
            label: "Name:",
            validation: { required: true }
        }, {
            field: "Address",
            label: "Address:",
            validation: { required: true }
        }]
    }).getKendoForm();

    form.bind("validateField", function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
        console.log("valid" + e.valid);
    });
</script>
In this article