i am using two forms in a jsp page.i want to submit form2 but it needs first form1 to be submitted then second form will be submitted.please help me how to only submit form2 without submitting form1 ..thankyou 🙂
<html:form action="action1">
<html:submit property=method><bean:message key="userform.login"/></html:submit>
</html:form>
<html:form action="action2">
<html:submit property=method><bean:message key="userform.contactus"/></html:submit></html:form>
You are not going to be able to submit a form without leaving the page unless you use :
Ajax ( as suggested ) – and on the ‘success’ return post form 2
or an Iframe
Iframe – post into an iframe on the page, the iframe page can trigger the posting of form2 (if form1 post is successful) by using javascript ‘parent.form2.submit()’