struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Glenn" <dagl...@soltec.net>
Subject RE: Icons next to form elements with validation errors
Date Mon, 03 Dec 2001 02:16:59 GMT
I have a related question. I architected our JSP framework at work to
allow specific field error messages to be available when fields don't
validate. In this way error messages can be written above/below/near
each field in error (for usability's sake) instead of in aggregate at
the top of form (ugly/messy/hard to use). How do I accomplish this using
the Struts validation package?

David Glenn
daglenn@soltec.net


-----Original Message-----
From: Ted Husted [mailto:husted@apache.org] 
Sent: Sunday, December 02, 2001 5:10 PM
To: Struts Users Mailing List
Subject: Re: Icons next to form elements with validation errors

The one other thing I've seen people do is add a companion field to the
ActionForm for each field they want to mark this way, and then test that
in the same way. But the messagesPresent tag is obviously less work!

Off topic, but a related idea is to write the label for a required field
in a different font when it is null. So, the required field start out in
red or maroon, but turn black if the form is retruned for validation,
and they pass. 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/struts/


David Winterfeldt wrote:
> 
> If you are using one of the more recent nightly builds
> there is a logic tag you could use.
> 
> <logic:messagesPresent property="username">
>    // insert image here
> </logic:messagesPresent>
> <html:text property="username" size="20"
> maxlength="100"/>
> 
> David
> 
> --- Angela Saval <saval@marimba.com> wrote:
> > I would like to be able to place an icon next to
> > each field in a form that
> > did not validate correctly.  Is this integrated into
> > the html input fields
> > tags some how?  If so, I am not seeing this.  For
> > example, I would like
> > something like
> >
> > <html:text property="username" size="20"
> > maxlength="100"
> > erroricon="/images/error.jpg"/>
> >
> > The only way that I see of doing something like this
> > now is to extend each
> > of the html tag definitions to include an error icon
> > attribute since I see
> > no way to extend a tag definition.
> >
> > Any insight on how others have solved this problem
> > would be appreciated.
> >
> > Angela
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> >
> 
> __________________________________________________
> Do You Yahoo!?
> Buy the perfect holiday gifts at Yahoo! Shopping.
> http://shopping.yahoo.com
> 
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>





--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message