This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Submit button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Submit button" Watch "Submit button" New topic
Author

Submit button

vijaya vedula
Greenhorn

Joined: Nov 29, 2006
Posts: 3
I am using onClick to submit to action class in submit button .
My JSP is populating data from one form and the action to which i am submitting is using another form.How to distinguish which form to submit.
mohit bahl
Ranch Hand

Joined: Mar 22, 2006
Posts: 48
Hi vijaya vedula

By default the submit will submit the form in which it has been declared. but if you want to choose then you can call a javascript function on submit and define the action to which you want to submit.

i hope this helps, if i have not understood your problem correctly then let me know.

cheers!


to err is human, but the company policy doesn't allow it!
Santosh Ramachandrula
Ranch Hand

Joined: Apr 04, 2004
Posts: 252
If you want the Action to use different form then configure the action and form in your struts-config.xml action mapping.
[ December 18, 2006: Message edited by: Santosh Ramachandrula ]

Thanks,
Santosh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Submit button
 
Similar Threads
the enter key forces a submit
object doesn't support this property or method
Struts 2.0
2 submit buttons with different action
how to create a form within form?