I think I ran into that problem before. It looks like you have found the
correct javascript to make it work. Please post this as a bug to
http://nagoya.apache.org/bugzilla/.


> -----Original Message-----
> From: Young, Wayne [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 01, 2001 11:13 AM
> To: Struts-Dev@Jakarta. Apache. Org (E-mail)
> Subject: radio button focus
>
>
> I am trying to set focus to a radio button using the
> <html:form> "focus"
> attribute, but the javascript generated doesn't work. I'm not
> sure if I'm
> not using the "focus" attribute on <html:form> incorrectly,
> or if this is a
> bug.
>
> Here's a snippet of the JSP: (some formatting removed)
> <html:form action="/postProductCategory" focus="productCategory[0]">
>   <html:radio property="productCategory"
> value="network">Network</html:radio>
>   <html:radio property="productCategory"
> value="connection">Connection</html:radio>
>   <html:submit property="next">Next</html:submit>
> </html:form>
>
> It generates javascript like: (BAD)
> <script language="JavaScript" type="text/javascript">
>   <!--
>
> document.forms["formProductCategory"].elements["productCategor
> y[0]"].focus()
>   // -->
> </script>
>
>
> The CORRECT javascript is: (GOOD)
> <script language="JavaScript" type="text/javascript">
>   <!--
>
> document.forms["formProductCategory"].elements["productCategor
> y"][0].focus()
>   // -->
> </script>
>
> Any help would be appreciated. Thanks.
>
> Wayne
> [EMAIL PROTECTED]
>

Reply via email to