Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Paul Clapham
Liutauras Vilda
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Struts
Submitting Multiple Forms From A Single Page
Ayan Biswas
Ranch Hand
Posts: 104
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I have 2 forms in a single page.Each form data should go to 2 methods in 2 separate action classes.
form1
<html:form action="searchHierarchy"> <html:button styleClass="commandExButton" disabled="false" property="action" onclick="javascript:formSubmit('searchhierarchy'); "> <bean:message key="button.search" />
form2
<html:form action="searchSupplier"> <html:button disabled="false" property="action" onclick="javascript:formSubmit1('search'); " > <bean:message key="button.search"/> </html:button>
javascript functions
function formSubmit(action) { alert(action); document.getElementById('action').value=action; document.forms(0).submit(); }
function formSubmit1(action) { //alert(document.forms[1].); alert(action); document.getElementById('action').value=action; document.forms[1].submit(); }
But the 2nd form does not get submmitted.Can anybody tell me how to deal with it?
AyanBiswas
Rebecca Hopper
Ranch Hand
Posts: 38
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Instead of:
document.getElementById('action').value = action;
You should
have:
document.forms[1].action.value = action;
SCJP 1.4
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Struts 1
form bean value not getting
Struts 1 :- Two Form submission from one jsp using one submit button
img tag empty src attribute causes duplicate form submission
Help needed with IE 6.0 submit
More...