maybe we could do something like this in the JSP - the idea is taken from the TextTag.java which knows to use the errorStyleClass when theres an error.
... <%@ page import="java.util.Iterator" %> <%@ page import="org.apache.struts.Globals" %> <%@ page import="org.apache.struts.taglib.TagUtils" %> <%@ page import="org.apache.struts.action.ActionMessages" %> <% String errorKey = Globals.ERROR_KEY; ActionMessages errors = TagUtils.getInstance() .getActionMessages(pageContext, errorKey); Iterator iter = errors.properties(); String focusProperty = "some_default_property"; if (iter.hasNext()) { focusProperty = (String) iter.next(); // default to first property } %> <html:form focus="<%= focusProperty %>" action="/someAction.do" method="post"> ... </html:form> Notes: 1. The default_property is the field you would normally focus on if there is no error. 2. It would be best to put this code in a tag library. 3. The javascript generated by the struts "focus" attribute may need to be improved (e.g. in a try...catch) just in case a property doesnt exist. Please let me know how this approach looks as I am also considering this for my app. Thanks, Paul ********************************************************************** This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender. ********************************************************************** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]