This is a migrated thread and some comments may be shown as answers.

Submitting Multiple Forms with a Single Button

1 Answer 2025 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 1
Joel asked on 14 Feb 2019, 07:39 PM

As the title states, is it possible to submit multiple partial views with a single button? Open to using javascript, jquery, ajax. 

I have them coming from the same model, but there are two partial views with separate forms, I am wondering if there is anyway to submit it with just using a single click?

Thanks

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 18 Feb 2019, 07:59 AM
Hello Joel,

I can suggest two relatively easy approaches to this:

  • If possible, wrap both partials in one single form so any <input type="submit" /> will POST all the inputs from both partial views
  • Alternatively, use something like document.getElementById("firstForm").submit(); and document.getElementById("secondForm").submit(); on the client-side click of a <button>. Of course, there are many ways to get the references to the <form> elements, this is up to the structure and logic you have.

 


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Joel
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or