|
| 1 | +--- |
| 2 | +title: Overview |
| 3 | +page_title: Kendo UI for jQuery Form Documentation | Form Overview | Kendo UI |
| 4 | +description: "Get started with the Kendo UI for jQuery Form and learn about its features and how to initialize the widget." |
| 5 | +slug: overview_kendoui_form_widget |
| 6 | +position: 1 |
| 7 | +--- |
| 8 | + |
| 9 | +# Form Overview |
| 10 | + |
| 11 | +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. |
| 12 | + |
| 13 | +* [Demo page for the Form](https://demos.telerik.com/kendo-ui/form/index) |
| 14 | + |
| 15 | +## Initializing the Form |
| 16 | + |
| 17 | +To initialize the Form, use the `<form>` tag. |
| 18 | + |
| 19 | +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. |
| 20 | + |
| 21 | +```dojo |
| 22 | + <form id="form"></form> |
| 23 | +
|
| 24 | + <script> |
| 25 | + $(document).ready(function () { |
| 26 | + $("#form").kendoForm({ |
| 27 | + validatable: { validationSummary: true }, |
| 28 | + orientation: "vertical", |
| 29 | + formData: { |
| 30 | + TextBox: "John Doe", |
| 31 | + NumericTextBox: 2, |
| 32 | + MaskedTextBox: 21313, |
| 33 | + DatePicker: new Date(), |
| 34 | + DateTimePicker: new Date(), |
| 35 | + Switch: true, |
| 36 | + DropDownList: 1 |
| 37 | + }, |
| 38 | + items: [ |
| 39 | + { |
| 40 | + field: "TextBox", |
| 41 | + label: "TextBox", |
| 42 | + validation: { required: true } |
| 43 | + }, |
| 44 | + { |
| 45 | + field: "NumericTextBox", |
| 46 | + editor: "NumericTextBox", |
| 47 | + label: "NumericTextBox", |
| 48 | + validation: { required: true } |
| 49 | + }, |
| 50 | + { |
| 51 | + field: "MaskedTextBox", |
| 52 | + editor: "MaskedTextBox", |
| 53 | + label: "MaskedTextBox", |
| 54 | + validation: { required: true } |
| 55 | + }, |
| 56 | + { |
| 57 | + field: "DatePicker", |
| 58 | + editor: "DatePicker", |
| 59 | + label: "Date Picker:", |
| 60 | + validation: { required: true } |
| 61 | + }, |
| 62 | + { |
| 63 | + field: "DateTimePicker", |
| 64 | + editor: "DateTimePicker", |
| 65 | + label: "Date Time Picker:", |
| 66 | + validation: { required: true } |
| 67 | + }, |
| 68 | + { |
| 69 | + field: "Switch", |
| 70 | + editor: "Switch", |
| 71 | + label: "Switch", |
| 72 | + validation: { required: true } |
| 73 | + }, |
| 74 | + { |
| 75 | + field: "DropDownList", editor: "DropDownList", label: "DropDownList", validation: { required: true }, editorOptions: { |
| 76 | + optionLabel: "Select item...", |
| 77 | + dataSource: [ |
| 78 | + { Name: "Item1", Id: 1 }, |
| 79 | + { Name: "Item2", Id: 2 } |
| 80 | + ], |
| 81 | + dataTextField: "Name", |
| 82 | + dataValueField: "Id" |
| 83 | + } |
| 84 | + } |
| 85 | + ] |
| 86 | + }); |
| 87 | + }); |
| 88 | + </script> |
| 89 | +``` |
| 90 | + |
| 91 | +## Referencing Existing Instances |
| 92 | + |
| 93 | +To get a reference to an existing Form instance: |
| 94 | + |
| 95 | +1. Use the [`jQuery.data()`](https://api.jquery.com/jQuery.data/) method. |
| 96 | +1. Once a reference is established, use the [Form API](/api/javascript/ui/form) to control its behavior. |
| 97 | + |
| 98 | + var form = $("#form").data("kendoForm"); |
| 99 | + |
| 100 | +## Functionality and Features |
| 101 | + |
| 102 | +* [Items]({% slug items_form_widget %}) |
| 103 | +* [Layout]({% slug layout_form_widget %}) |
| 104 | +* [Groups]({% slug groups_form_widget %}) |
| 105 | +* [Orientation]({% slug orientation_form_widget %}) |
| 106 | +* [Validation]({% slug validation_form_widget %}) |
| 107 | +* [Accessibility]({% slug accessibility_kendoui_form_widget %}) |
| 108 | + |
| 109 | +## See Also |
| 110 | + |
| 111 | +* [Basic Usage of the Form (Demo)](https://demos.telerik.com/kendo-ui/form/index) |
| 112 | +* [JavaScript API Reference of the Form](/api/javascript/ui/form) |
0 commit comments