You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/01/07 05:24:57 UTC

DO NOT REPLY [Bug 15816] - html:form focus in pages with several forms

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15816>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15816

html:form focus in pages with several forms

craig.mcclanahan@sun.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX



------- Additional Comments From craig.mcclanahan@sun.com  2003-01-07 04:24 -------
This is going to be a usage restriction, unless someone can come up with a
strategy that can make your scenario work :-(.

The problem is that Struts creates a name attribute for the <form> element based
on the form bean name from the action you're submitting to.  Therefore, if you
have two forms on the same page that submit to the same form bean (which is true
in your example case, because you're submitting two different forms to the same
action), then duplicate form names will be generated.  The by-name looking in
the generated JavaScript, then, will find only the first one.

To avoid this problem, you need to have your forms use a different form bean, so
that the form names will be unique.

As to your second issue, Struts will blithely set the focus to a hidden field if
you ask it too -- but what happens in real life is totally up to your browser.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>