> 
> If there is no name associated with your declared HTML form then use
> document.forms[0] (basically the first form defined for the HTML document)
> Personally I caution against using this convention as the caller does not
> properly identify the form (by name)


Hi Martin!

Why do you caution against using forms[0]?
I'm not arguing against this, I'm a total newbie in javascript.
I just ask because I had to reference the form and I used
forms[0] despite of the fact that I'm using html:form and I have
the name of the form.
But the html:form is generated based on the action attribute
so I thougth that if someone changes the action mapping in struts
config the javascript won't break with forms[0].
Isn't the forms[0] reliable?

Note that I have only one form in my jsp page.

Thanks,
Tamas


Anyone else ?
> M-
> ----- Original Message -----
> From: "Jason King" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <user@struts.apache.org>
> Sent: Tuesday, September 13, 2005 11:05 AM
> Subject: Re: How to replace normal html-from through html:form in Struts?
> Example
> 
> 
> > gollinger wrote:
> >
> >><form name="next" action="/jsp/awp/awpoutput.jsp" target="display" />
> >><script language="javascript">
> >> document.next.submit();
> >></script>
> >>
> >>
> >>The problem I have is that the form tag in Struts has no name!
> >>
> >>Why?
> >>So how can I execute the java-script? Which name should I use instead?
> >>
> >>Regards Antonio
> >>
> > document.form[0] or form[1] will work.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

Reply via email to