To elaborate on Frank's reply, the name of the form comes from the name
attribute of the <action-mapping> in the struts-config, but this value is
just a reference to the <form-bean> configuration.  Within the context of
the <action-mapping>, I might even call it a misnomer.  People new to struts
might be better served by a "bean", "form" or "action-form" attribute.
Anyway, it is what it is.

You could also reference it by using the it's index in the array of forms in
the DOM.  The first form encountered by the browser will have a 0 (zero)
index.  For example, the first form would be document.forms[0], the second,
document.forms[1], etc.  The former is obviously much more declarative.

Hope none of this confuses.


On 7/13/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:

On Thu, July 13, 2006 10:58 am, Akshay Ahooja wrote:
> Hi,
>
> Does anyone know how to call a Struts action using Javacript...
>
> I am using:
> <html:form action+"...">
>
> ...
>
> </html:form>
>
>
> I know for regular form tags (<form>) you can use:
> document.formname.submit
> ()...
>
> How would you do it for <html:form>? I have to use this because I am
using
> the Struts Bridge in Jetspeed-2...

You can do it exactly the same way... <html:form> renders a <form>
underneath.  IIRC, the name of the form is the value of the action
attribute, but check the source of a page using <html:form> to be sure.

> Akshay

Frank

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to