This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Multiple forms submission with one button" Watch "Multiple forms submission with one button" New topic
Author

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.

thanks

swapna
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30392
    
150

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.


[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
Bartender

Joined: Oct 29, 2001
Posts: 8877
    
    8

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?


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
 
subject: Multiple forms submission with one button