Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tiles Multiform submit

 
Ashwin Puthran
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I have embedded 3 forms into my web page using tiles framework.
all 3 forms have some information(i.e text fields) with submit button on the 3 rd form.
Now on click of the submit button on 3rd form i wanna send all data present in 3 forms by populating a formbean and directing to a particular struts action
Hw do i do this?..Coz i hv only submitted one form at a tym from a jsp page.
Is there a way to merge alll form elements to populate a single form bean before submitting the form,
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'd have to do it with JavaScript.
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes there is a possibility to merge three forms into 1- but that requires you to make a 1 common action submit for all 3 forms.

other way as David suggested it can be done in Javascript.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't have three separate forms on a single page submit to the same action--it needs to either be a single form, or use hidden fields/etc. to store fields from the other forms, which would need to be filled on submit.
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:You can't have three separate forms on a single page submit to the same action--it needs to either be a single form, or use hidden fields/etc. to store fields from the other forms, which would need to be filled on submit.


As i said in my previous posts. Make 3 forms into 1 form.
 
Ashwin Puthran
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,
Thanks for your help.I have used hidden fields to store the required info as of now. But i seriously feel that there should have been some alternative to store multiple form fields to a single formbean and then submit on a single action.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why? Normally if you have different forms you'd want them processed by different back-end logic--why else would you have separate forms?
 
Shriram Pandit
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David I am using struts tiles and multiple form submission is worked for me using Javascript
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic