Multiple Submit Buttons?
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I would like to submit a form that has multiple submit buttons. For each button I would like to send a different action.
How can I dynamically populate the action parameter to my form when doing this?
<html:form action="???">
<%-- Submit Buttons --%>
<html:submit property="Confirm"><fmt:message key="label.confirm"/></html:submit>
<html:submit property="Re-enter"><fmt:message key="label.reenter"/></html:submit>
<html:submit property="Logout"><fmt:message key="label.logout"/></html:submit>
<%-- Etc... --%>
</html:form>
How can I dynamically populate the action parameter to my form when doing this?
<html:form action="???">
<%-- Submit Buttons --%>
<html:submit property="Confirm"><fmt:message key="label.confirm"/></html:submit>
<html:submit property="Re-enter"><fmt:message key="label.reenter"/></html:submit>
<html:submit property="Logout"><fmt:message key="label.logout"/></html:submit>
<%-- Etc... --%>
</html:form>
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi,
You can do this in two ways... One by writing different actions to the buttons and calling them onclick or write the different actions as different method in a single DispatchAction class and calling different method on different button clicks.
You can do this in two ways... One by writing different actions to the buttons and calling them onclick or write the different actions as different method in a single DispatchAction class and calling different method on different button clicks.
Bloo Barton
Ranch Hand
Posts: 63
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
How would I do the first method?
Srilakshmi Vara
Ranch Hand
Posts: 169
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Write to action classes and two action mappings in struts-config file with the same actionform.
In the jsp add the below javascript on onClick event
function formAction() {
document.form.action="aaa.do"
document.form.submit();
}
Srilakshmi
In the jsp add the below javascript on onClick event
function formAction() {
document.form.action="aaa.do"
document.form.submit();
}
Srilakshmi
| I think she's lovely. It's this tiny ad that called her crazy: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |









