On Mon, 25 Jun 2001, Andreas Amundin wrote:

> >From: Craig R. McClanahan
> >
> >On Sun, 24 Jun 2001, Andreas Amundin wrote:
> >
> >> 1. How can I submit two different actions for the same form?
> >
> >To change to a different action, you will need to change the destination
> >of the form submit.  This requires JavaScript at the client end.
> 
> Thanks for the reply Craig.
> 
> Is there a common practice for using javascript in combination with struts
> or is best to not mix the two?
> 
> How easy would it be to write your own tag to handle it?  
> 

The thing to remember is that custom tags are executed as the page is
being *created* on the server, while JavaScript is executed later, while
the page is being *displayed* on the client.  Therefore, you cannot really
use a custom tag to execute JavaScript code -- but you can use it to
generate JavaScript.  For example, the <html:form> tag does this for the
"focus" attribute.

Basically, Javascript in Struts pages is used exactly like you would use
it in a static HTML page.

> Thanks,
> Andreas
> 

Craig


Reply via email to