On Thu, 5 Apr 2001 [EMAIL PROTECTED] wrote:

> Hi,
> I 'am using staruts for a small pilot project.
> On the form bean when validate method collect errors and shows in JSP,
> I want at the same time my cursor should move to the first error field. how
> I can acheive this.. 
> does anybody knows about this...
> 

One approach to consider is to remember that the "focus" attribute of the
form can take a runtime expression, instead of a String constant, to
specify the name of the field to send the cursor to.  If you had some
mechanism to define a bean (with a string value) named "errorField" then
you could say:

        <jsp:useBean id="errorField" class="java.lang.String"/>
        <form action="/xxx" focus="<%= errorField %>">
          ...
        </form>

> Thanks N Regards
> 
> TAHIR IQBAL
>  Information Services Division (ISD)
>  Loblaw Companies Limited
>  6 Monogram Place
>  Weston, ON - M9R 4CR
> *     416-246-7831
>  Email        [EMAIL PROTECTED]                                         "Stay Cool
> And U'll Rule"
> 
> 
> 
Craig


Reply via email to