File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Multiple forms submission with one button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Multiple forms submission with one button" Watch "Multiple forms submission with one button" New topic

Multiple forms submission with one button

Swapna latha
Ranch Hand

Joined: Dec 18, 2011
Posts: 70
Hi all,

I am developing an astrology website, in which there are two forms , two forms are for male and female.

Both male and female enter their date of birth details as name, date of birth, time of birth and place of birth. I have a simple pojo class with the fields as mentioned. I can able to save single form details.

I am not getting any idea how to store two forms information on one click.


Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32319

Is this Struts 1 or 2? In Struts1, you can't. You'd have to do one of the following:
1) Create a form with both
2) Have Struts automatically populate one form and use request.getParameter() in your action to populate the other one manually.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Joe Ess

Joined: Oct 29, 2001
Posts: 9126

Why do you have two separate forms if the information on both forms is the same? Why not have a radio button for male/female and use a single form?
If you have to display male and female information, why not make a single form and sort out the data in your action?

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Multiple forms submission with one button
It's not a secret anymore!