KendoForm jQuery

1 Answer 23 Views
Form
Mike
Top achievements
Rank 1
Iron
Mike asked on 07 Jun 2024, 09:25 PM

For the KendoForm jQuery control, how do I control the forms method and action attributes.

Does the form default to sending the e.model ?

I don't see any attributes to change the method [get or post,] nor the action url.

 

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 12 Jun 2024, 10:15 AM

Hi Mike,

You can use the submit Form event handler which contains the model via the e.model property and call the desired action method.

Please refer to the following SO thread: https://stackoverflow.com/questions/65619541/kendo-form-submit-function-is-not-firing

Also, you can examine the next Kendo UI for MVC Form demo that makes a request to the server on submit. 

https://demos.telerik.com/aspnet-mvc/form

And examine the controller in the IndexController.cs tab

Regards,
Nikolay
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
Mike
Top achievements
Rank 1
Iron
commented on 12 Jun 2024, 12:11 PM

Thanks Nikolay,

I was thinking the kendoform might provide action and method and send the e.nodel by default.

I did get it working.  The old PHP app template I am trying to extend  was including moo.js which takes over all form\ajax which was throwing me off too.

 

I ended up with this and the form data is sent with ease over to my service.

 submit: function(e) {
            e.preventDefault();
            jQuery.ajax({
                url: "https://mydomain.biz/dateservice/newdate.cfm",
                method: "POST",
                dataType: "json",
                data: e.model
                }).done(function(data){
                    alert("we are done");
               
                });
           
},
Nikolay
Telerik team
commented on 17 Jun 2024, 10:18 AM

Hi Mike,

Thank you for the update. I am happy to hear you managed to get this working. Sharing the solution will benefit others facing the same scenario.

Regards,

Nikolay

 

 

Tags
Form
Asked by
Mike
Top achievements
Rank 1
Iron
Answers by
Nikolay
Telerik team
Share this question
or