You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Matthias Kerkhoff <ma...@BESToffers.de> on 2000/12/19 02:12:41 UTC
Re[2]: sending user to a anchor on a page.
Pardon me for jumping in here,
>> another way to do this would be by changing the form's focus to the
> "first" invalid field. ... Not that I know how you would actually do
> that ...
> On 12/19/2000 at 12:45 AM Geoffrey Simmons wrote:
>> You can do that with Javascript, and I'm relatively certain that it's
> the only way.
> I just had a vague idea about getting Struts to write the Javascript by
> somehow changing the focus property for the form tag. Which is the part
> I'm not sure about.
I'm using a slightly out-dated build (11/13) so the following may not be
true for the current build....
... anyway, in this old build, there is a form tag attribute named "focus"
that exactly does what you're discussing about. If present, the form tag
generates a little JavaScript, that sets the focus to the form field named
like the "focus" attribute.
--
Matthias (mailto:make@BESToffers.de)
Re: Re[2]: sending user to a anchor on a page.
Posted by Ted Husted <ne...@husted.com>.
On 12/19/2000 at 2:12 AM Matthias Kerkhoff wrote:
> If present, the form tag generates a little JavaScript, that sets the
focus to the form field named like the "focus" attribute.
The form attribute is still current, and used in the example
application. But how would you change it in response to a validation
error?
-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/