You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ri...@tembit.de on 2003/06/11 18:26:17 UTC

FocusTag: Set Focus on first field that failed serverside validat ion

Hi there,

in recent projects, we had a problem to set the focus to the first field
that creates an error (e.g. serverside validation failed), especially with
large formulars.
To fix this problem, we created a FocusTag 

<app:focusTag action="/siteWrite" property="ste_name"/>

which sets the focus to the field provided, if no error occurs. Otherwise it
sets the focus to the first field that failed serverside validation.

Since you have to provide the action of the form, we think it would be
better to provide this function directly in the Struts html:form by adding
an additional attribute (e.g setOnErrorFocus="true") to turn it on or off.

If somebody is interested we can provide this tag.

We can provide an implementation of html:form with this additional
functionality too.


Denis, Uwe


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org