From: "Randy Kennedy" <[EMAIL PROTECTED]>

> I am wondering if there is a way to set the focus after a form has been
> validated through Struts and deemed invalid?  Currently, focus always
> goes to the first form element.  Is there not a way to make this go to
> the first INVALID form element?

I think you could do it fairly easily with Struts-EL...

<html-el:form action="/chooseProfile" focus="${focusField}">

Now all you have to do is set a request Attribute named 'focusField' with
the name of the appropriate form element.  I'm thinking... override
'validate' in your Action, call super.validate(...) and you'll have the
errors.  Figuring out which one is "first" might be problematic though...

-- 
Wendy Smoak



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to