FormTagHelper
Kendo UI Form TagHelper FormTagHelper class.
Definition
Namespace:Kendo.Mvc.TagHelpers
Assembly:Kendo.Mvc.dll
Syntax:
[HtmlTargetElement("kendo-form")]
[HtmlTargetElement("kendo-form", ParentTag = "editable")]
[HtmlTargetElement("wizard-step-form", ParentTag = "wizard-step")]
[RestrictChildren("form-items", new string[] { "messages", "validatable", "grid", "buttons-template", "form-smart-paste" })]
[OutputElementHint("form")]
public class FormTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent, ITemplateComponent
Inheritance: objectTagHelperTagHelperBaseFormTagHelper
Implements:
Inherited Members
Example:
@addTagHelper *, Kendo.Mvc
<kendo-form name="form" form-data="@Model" method="POST" asp-controller="Form" asp-action="Tag_Helper">
<validatable validate-on-blur="true" validation-summary="true" />
<form-items>
<form-item type="group">
<item-label text="Registration Form" />
<form-items>
<form-item field="FirstName">
<item-label text="First Name:" />
</form-item>
<form-item field="LastName">
<item-label text="Last Name:" />
</form-item>
</form-items>
</form-item>
</form-items>
</kendo-form>
Child Tags
Constructors
Initializes a new instance of the FormTagHelper class.
Properties
Specifies the template which is used for rendering the Form buttons.
public string ButtonsTemplate { get; set; }
Specifies the template which is used for rendering the Form buttons. This option expects the name of a JavaScript function that will be called to return the template.
public string ButtonsTemplateHandler { get; set; }
Specifies the template which is used for rendering the Form buttons. This option expects the ID of the script element that contains the template.
public string ButtonsTemplateId { get; set; }
Specifies the template which is used for rendering the Form buttons. This option expects the IHtmlContent instance containing the created HTML.
public IHtmlContent ButtonsTemplateView { get; set; }
Specifies if the clearButton should be rendered on initialization.
public bool? ClearButton { get; set; }
Specifies if the first editor of the form will be focused on initialization.
public bool? FocusFirst { get; set; }
Callback function that could be used to change the default format of the automatically generated labels.
public string FormatLabel { get; set; }
Provides the data model of the Form. The widget renders the form fields based on their data type, unless the items option is specified.
public object FormData { get; set; }
Specifies whether the TagHelper is nested.
[HtmlAttributeNotBound]
public bool IsNested { get; }
Specify the layout of Form content. Valid options are: grid: This is equivalent to display: grid. It defines the form element as a grid container and establishes a new grid formatting context for its contents..
public string Layout { get; set; }
The name of the JavaScript function that will handle the change event. Triggered when the form model is updated.
public string OnChange { get; set; }
The name of the JavaScript function that will handle the clear event. Triggered when the form is cleared.
public string OnClear { get; set; }
The name of the JavaScript function that will handle the submit event. Triggered when the form is submitted.
public string OnSubmit { get; set; }
The name of the JavaScript function that will handle the validate event. Fired when the validation of the entire form completes.
public string OnValidate { get; set; }
The name of the JavaScript function that will handle the validateField event. Fired when the validation state of a field changes.
public string OnValidateField { get; set; }
Configures the Form orientation. Available options are "horizontal" and "vertical".By default, the Form is rendered with vertical orientation.
public string Orientation { get; set; }
Sets a value controlling the size of the input.
public ComponentSize? Size { get; set; }
Represents a collection of templates defined for the component.
[HtmlAttributeNotBound]
public IDictionary<string, string> Templates { get; }
Implements:
Methods
Gets the initialization script.
protected override string GetInitializationScript()
The initialization script.
Overrides:
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Overrides:
Serializes the defined settings.
public override IDictionary<string, object> Serialize()
Overrides:
SerializeEvents method.
protected override Dictionary<string, object> SerializeEvents()
Overrides:
SerializeSettings method.
protected override Dictionary<string, object> SerializeSettings()
Overrides:
Writes the HTML output.
protected override void WriteHtml(TagHelperOutput output)
The TagHelper output.
Overrides: