struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Neff <>
Subject Re: [S2] Problem with list of submit buttons
Date Fri, 29 Aug 2008 15:39:15 GMT
Ylva Degerfeldt wrote:
> Hi everyone,
> ...
> Maybe I could use the "onclick" attribute of s:submit but I don't know
> the syntax for sending a value to the Action there. (Isn't that
> javascript?)
> Can somebody please help me with this?
> Thanks in advance!
> /Ylva
Are you asking on how to get different buttons to do different actions?

If so, then here is what I did:


<s:form id="myForm" name="myForm" action="OriginalAction" theme="simple">

<input type='button' onclick="myJavaScriptMethod();" value='button label 


In the <head> section:

      function myJavaScriptMethod() {
          document.myForm.action = "/myProject/NewAction.action";

And that is how I programmatically set different actions from javascript.

Is there a better way?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message