Using Kendo Button. How to make it submit form

1 Answer 1603 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/.

DAVE
Top achievements
Rank 1
commented on 16 Jul 2024, 07:47 PM

Anton, This is great!  This would have been helpful in the demos as I've spent the last few hours hunting this down. :-)
Anton Mironov
Telerik team
commented on 19 Jul 2024, 11:16 AM

Hi Dave,

Thank you for the kind words!

I will comment this with the Team and we probably will add this example in a demo or in the documentation.


Best Regards,
Anton Mironov

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