forgive the triple-negative:
I'm not sure if I'm not using the "focus" attribute
on <html:form> incorrectly, or if this is a bug.
it should read:
I'm not sure if I'm using the "focus" attribute
on <html:form> incorrectly, or if this is a bug.
Thanks. :)
Wayne
[EMAIL PROTECTED]
-----Original Message-----
From: Young, Wayne [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 01, 2001 10: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["productCategory[0]"].focus()
// -->
</script>
The CORRECT javascript is: (GOOD)
<script language="JavaScript" type="text/javascript">
<!--
document.forms["formProductCategory"].elements["productCategory"][0].focus()
// -->
</script>
Any help would be appreciated. Thanks.
Wayne
[EMAIL PROTECTED]