New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent API for configuring the Kendo UI Form for ASP.NET MVC events.

Definition

Constructors

Initializes a new instance of the FormEventBuilder class.

C#
public FormEventBuilder(IDictionary<string, object> events)
Parameters:eventsIDictionary<string, object>

The Form event handlers.

Example:
C#
@( Html.Kendo().Form()
.Name("Form")
.Events(events =&gt; events
.Validate("onValidate")
)
)

Methods

Triggered when the form model is updated.

C#
public FormEventBuilder Change(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

FormEventBuilder

Example:
C#
@( Html.Kendo().Form()
.Name("Form")
.Events(events =&gt; events
.Change(
function(event){
/*handle event*/
}
)
)
)

Triggered when the form model is updated.

C#
public FormEventBuilder Change(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the change event.

Returns:

FormEventBuilder

Example:
C#
@( Html.Kendo().Form()
.Name("Form")
.Events(events =&gt; events
.Change("onChange")
)
)

Triggered when the form is cleared.

C#
public FormEventBuilder Clear(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The name of the JavaScript function that will handle the clear event.

Returns:

FormEventBuilder

Example:
C#
@( Html.Kendo().Form()
.Name("Form")
.Events(events =&gt; events
.Clear(
function(event){
/*handle event*/
}
)
)
)

Triggered when the form is cleared.

C#
public FormEventBuilder Clear(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the clear event.

Returns:

FormEventBuilder

Example:
C#
@( Html.Kendo().Form()
.Name("Form")
.Events(events =&gt; events
.Clear("onClear")
)
)

Triggered when the form is submitted.

C#
public FormEventBuilder Submit(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

FormEventBuilder

Example:
C#
@( Html.Kendo().Form()
.Name("Form")
.Events(events =&gt; events
.Submit(
function(event){
e.preventDefault();
var data = ["Rocky","Rambo"];
$.ajax({
url: "@Url.Action("FormPost","Home")",
method: "POST",
data: {
"form": e.model,
"additionalData": data
}
});
}
)
)
)

Triggered when the form is submitted.

C#
public FormEventBuilder Submit(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the submit event.

Returns:

FormEventBuilder

Example:
C#
@( Html.Kendo().Form()
.Name("Form")
.Events(events =&gt; events
.Submit("onSubmit")
)
)

Fired when the validation of the entire form completes.

C#
public FormEventBuilder Validate(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

FormEventBuilder

Example:
C#
@( Html.Kendo().Form()
.Name("Form")
.Events(events =&gt; events
.Validate(
function(event){
/*handle event*/
}
)
)
)

Fired when the validation of the entire form completes.

C#
public FormEventBuilder Validate(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the validate event.

Returns:

FormEventBuilder

Example:
C#
@( Html.Kendo().Form()
.Name("Form")
.Events(events =&gt; events
.Validate("onValidate")
)
)

Fired when the validation state of a field changes.

C#
public FormEventBuilder ValidateField(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

FormEventBuilder

Example:
C#
@( Html.Kendo().Form()
.Name("Form")
.Events(events =&gt; events
.ValidateField(
function(event){
/*handle event*/
}
)
)
)

Fired when the validation state of a field changes.

C#
public FormEventBuilder ValidateField(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the validateField event.

Returns:

FormEventBuilder

Example:
C#
@( Html.Kendo().Form()
.Name("Form")
.Events(events =&gt; events
.ValidateField("onValidateField")
)
)