Kendo UI for jQuery Form Overview
The Kendo UI Form widget allows you to generate and manage forms. Through a variety of configuration options, it makes creating and customizing forms a seamless experience. Achieve the desired form appearance by using default or custom editors, choose layout and orientation, display the editors in groups and columns, and configure validation.
The Form is part of Kendo UI for jQuery, a
professional grade UI library with 110+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.
Initializing the Form
To initialize the Form, use the <form>
tag.
The following example demonstrates how to initialize the Form from an existing <form>
element. The items
option is set, and it allows configuring Kendo UI widgets as form field editors.
Note, that nodeName
should not be used as an id of the fields in the formData.
<form id="form"></form>
<script>
$(document).ready(function () {
$("#form").kendoForm({
validatable: { validationSummary: true },
orientation: "vertical",
formData: {
TextBox: "John Doe",
NumericTextBox: 2,
MaskedTextBox: 21313,
DatePicker: new Date(),
DateTimePicker: new Date(),
Switch: true,
DropDownList: 1
},
items: [
{
field: "TextBox",
label: "TextBox",
validation: { required: true }
},
{
field: "NumericTextBox",
editor: "NumericTextBox",
label: "NumericTextBox",
validation: { required: true }
},
{
field: "MaskedTextBox",
editor: "MaskedTextBox",
label: "MaskedTextBox",
validation: { required: true }
},
{
field: "DatePicker",
editor: "DatePicker",
label: "Date Picker:",
validation: { required: true }
},
{
field: "DateTimePicker",
editor: "DateTimePicker",
label: "Date Time Picker:",
validation: { required: true }
},
{
field: "Switch",
editor: "Switch",
label: "Switch",
validation: { required: true }
},
{
field: "DropDownList", editor: "DropDownList", label: "DropDownList", validation: { required: true }, editorOptions: {
optionLabel: "Select item...",
dataSource: [
{ Name: "Item1", Id: 1 },
{ Name: "Item2", Id: 2 }
],
dataTextField: "Name",
dataValueField: "Id"
}
}
]
});
});
</script>
Referencing Existing Instances
To get a reference to an existing Form instance:
- Use the
jQuery.data()
method. -
Once a reference is established, use the Form API to control its behavior.
var form = $("#form").data("kendoForm");