If you view the source the form renders as haveing the name of the formbean
that you define in struts-config.xml..

You can make you js functions more portable by feeding them the form name
when you call them. This way you don't need the form name. I prefer to use
document.form[myform] rather than document.myform because in reality you are
accessing an array.


Function myfunction(form) {
    document.forms[form].etc
}


<form onsubmit="myfunction(this.form)">

Hope this helps mark


On 18-12-2002 13:49, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:

> check documentation for html:form tag...
> 
> -----Original Message-----
> From: Mohammed.Rafeeq [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 18, 2002 1:44 PM
> To: struts-user
> Subject: how to give form name in struts?
> 
> 
> hi all ,
> i'm a newbie.
> 
> how to give the form name when using  struts-html.tld
> 
> <html:form action="/saveSubscription" focus="host">
> 
> 
> i want to submit the form on click of a link, i thought of calling
> javascript:document.formname.submit() onclick of the link
> 
> 
> but in struts syntax is there provision to specify the form name?
> 
> 
> -rafeeq
> 
> 
> **************************************************************************
> This email (including any attachments) is intended for the sole use of the
> intended recipient/s and may contain material that is CONFIDENTIAL AND
> PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
> distribution or forwarding of any or all of the contents in this message is
> STRICTLY PROHIBITED. If you are not the intended recipient, please contact
> the sender by email and delete all copies; your cooperation in this regard
> is appreciated.
> **************************************************************************
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 


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

Reply via email to