Using Kendo Button. How to make it submit form

1 Answer 915 Views
Button
Sean
Top achievements
Rank 1
Iron
Iron
Sean asked on 29 Jan 2023, 11:35 PM
How do you make Html.Kendo().Button() submit a form?

1 Answer, 1 is accepted

Sort by
0
Anton Mironov
Telerik team
answered on 01 Feb 2023, 11:57 AM

Hi Sean,

Thank you for the question.

In order to achieve the desired behavior, I would recommend adding HtmlAttributes to the Telerik UI Button. The HtmlAttributes should point to the submit type of the button and the id(name) of the form that should be submitted.

Here is an example:

@(Html.Kendo().Button()
    .Name("textButton")
    .HtmlAttributes( new { form = "formExample", type = "submit" } )
    .Content("Submit")
)
Give a try to the approach above and let me know if further assistance is needed.

Kind Regards,
Anton Mironov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Button
Asked by
Sean
Top achievements
Rank 1
Iron
Iron
Answers by
Anton Mironov
Telerik team
Share this question
or